Download MetaTrader 5
To add comments, please log in or register
No PC at hand? Communicate with friends using your mobile phone!
Uncl3B0B
29
Uncl3B0B 2015.08.24 12:59 

I need to get into the TrailingStop and BreakEven value specific candle, for example H1 10:00. As at any time during the day to gain Size, Low, High some specific candle?
My simple suggestion is not working

double A = iHigh(NULL,PERIOD_H1,Bars(NULL,PERIOD_H1,D'10:00:00', D'10:59:59'));         
double B = iLow (NULL,PERIOD_H1,Bars(NULL,PERIOD_H1,D'10:00:00', D'10:59:59'));


Now on the TrailingStop and BreakEven use value of X, which partially substitutes the value of certain candles:

double X   = OrderOpenPrice() - OrderStopLoss();

Where X can be used for following BE:

double BE   = NormalizeDouble(((X)*0.3),5);


For example BreakEven that use: 

 for(p = 0; p < OrdersTotal(); p++) {if (OrderSelect(p,SELECT_BY_POS,MODE_TRADES) && OrderType()==OP_BUY && Ask >= OrderOpenPrice() + BE
     && OrderMagicNumber()==Magic_number && OrderStopLoss()<OrderOpenPrice()) 
   { modify=OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice(), OrderTakeProfit(), 0, Blue);}}
 for(p = 0; p < OrdersTotal(); p++) {if (OrderSelect(p,SELECT_BY_POS,MODE_TRADES) && OrderType()==OP_SELL && Bid <= OrderOpenPrice() - BE
     && OrderMagicNumber()==Magic_number && OrderStopLoss()>OrderOpenPrice()) 
   { modify=OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice(), OrderTakeProfit(), 0, Red );}}

 

It would help me if I knew how to identify Low / High candles any Day or Week. 

 

thanks 

/
To add comments, please log in or register