# Plugins for writing coding text in the topics

**URL:** <https://meta.discourse.org/t/plugins-for-writing-coding-text-in-the-topics/154460>\
**Category:** Product Support\
**Created:** [June 10, 2020, 11:01pm UTC](https://meta.discourse.org/t/plugins-for-writing-coding-text-in-the-topics/154460 "2020-06-10T23:01:37Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Thamer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thamer/32/183183_2.png) [@Thamer](https://meta.discourse.org/u/Thamer)\
**Post date:** [June 10, 2020, 11:21pm UTC](https://meta.discourse.org/t/plugins-for-writing-coding-text-in-the-topics/154460/5 "2020-06-10T23:21:07Z")

</div>

I think I got it, but for example in this code, how about the colors for some functions? It is displaying some colors but not as the picture is shown in discord.

The language is python.

```python
input long MagicN = 1234;

CTrade negocio;
CPositionInfo posicao;
bool InseriuParcial = false;

void OnTrade()
{
   ExpiringOrdersPartial(_Symbol, MagicN);
}

void OnTick()
{   
   //....
   
   bool pos = posicao.SelectByMagic(_Symbol, MagicN);
   
   if (pos) && (!InseriuParcial)
   {
      string comment = "[part:" + IntegerToString(posicao.Ticket()) + "]"; 
      if (PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL)
      {
         negocio.BuyLimit(1.0, simbolo.Last() -500, _Symbol, 0, 0, orderTypeTime, 0, comment + " Partial");
         negocio.BuyLimit(1.0, simbolo.Last()-1000, _Symbol, 0, 0, orderTypeTime, 0, comment + " Partial");
      }
      else
      {
         //....
      }
      InseriuParcial = true;
   }
   
   //....
}

void ExpiringOrdersPartial(string symbol, long m_magic)
{  
   int total = OrdersTotal();
   for(int i = total - 1; i >= 0; i--)
   {    
      ulong order_ticket = OrderGetTicket(i);
      
      if((OrderGetString(ORDER_SYMBOL) != symbol) || (OrderGetInteger(ORDER_MAGIC) != m_magic))
         return;
      
      string comment = OrderGetString(ORDER_COMMENT);
      string tokenB = "[part:";
      string tokenE = "]";
      
      int posB = StringFind(comment,tokenB);
      if (posB != -1)
      {
         int posE = StringFind(comment,tokenE, posB + StringLen(tokenB));
         if (posE == -1)
            return;
         
         string position_ticketS = StringSubstr(comment, posB + StringLen(tokenB), posE - (posB + StringLen(tokenB)));
         ulong position_ticket = (ulong)StringToInteger(position_ticketS);
         
         if (!PositionSelectByTicket(position_ticket))
            OrderDelete(order_ticket);
      }
   }
}

```

---

_[View the full topic](https://meta.discourse.org/t/plugins-for-writing-coding-text-in-the-topics/154460)._
