http://codeformatter.blogspot.com/2009/06/about-code-formatter.html
Here is an example
//+------------------------------------------------------------------+
//| Calculate open positions
//+------------------------------------------------------------------+
int CalculateCurrentOrders(string symbol)
{
int buys=0,sells=0;
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC)
{
if(OrderType()==OP_BUY) buys++;
if(OrderType()==OP_SELL) sells++;
}
}
// return orders volume
if(buys>0) return(buys);
else return(-sells);
}
You can configure a number of format settings, however this is the code block i use for this blog:
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">
Your Code Block</code></pre>
No comments:
Post a Comment