Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 839

 
for(int i=0;i<OrdersHistoryTotal(); i++)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
        {  
         if(OrderType()==OP_SELL)
          {  
           if(OrderStopLoss()>OrderOpenPrice())
            {                     
              if(OrdersTotal() == 0)
              {              
               double SELLprice=Bid;  
               int ticket =OrderSend(Symbol(), OP_SELL,Lot*=2,SELLprice, 3,SELLprice+StopLoss* Point, 0, "", MagicNumber,0, clrNONE);
                 
              }
            }            
          }              
        }
     }     
подскажите пожалуйста,я хочу сделать чтоб мой код увеличивал LOT в двое при убыточной сделки,а при прибыльной LOT возвращался в первоначальный объём !  
 
evillive:
To display on all bars, you have to count all bars, as it is usually done in indicators.

Did it this way, it's all the same. Only on the last bar there is a value.

#property indicator_separate_window
#property indicator_buffers 1
#property  indicator_color1 Blue
 
double balance[];
 
int init()
{
    IndicatorShortName( "vGrafBalance" );
    IndicatorDigits( 2 );
 
    SetIndexStyle( 0, DRAW_LINE );
    SetIndexBuffer( 0, balance );
    SetIndexLabel( 0, "Balance" );
}
int start()
{
    int counted_bars=IndicatorCounted();                      
    int limit;
//----
    if(counted_bars>0)
      counted_bars--;
   
    limit=Bars-counted_bars-1;
    
    for (int i=0;i<limit;i++)balance[i] = GlobalVariableGet( "vGrafBalance" );

    return(0);
 
How do I find out past MA values?
 
At what minimum distance from the price can an expert place a pending order?
 
favidu:
At what minimum distance from the price can an Expert Advisor place a pending order?

Double spread

 

Many thanks for helping newcomers -evillive



 
Hi all. Can you tell me where to find a video on how to write indicators? Lots of EAs, but I can't find anything on inductors!
 
CJIeCaPb:

Double spread

No.

StopLevel.

If it == 0, then double spread.

 
CJIeCaPb:
How do I find out the past value of the MA?
iMA(blah, blah, blah, the right bar);
 

How can I make the bar of the histogram in McDi to be a different colour when the value is smaller than the previous bar?

and what is the easiest way to load all available chart history?