Download MetaTrader 5

problem with code

To add comments, please log in or register
Use MQL5 Cloud Network. It is secure!
Grzegorz 2016.03.09 16:56 
Hi, I have got some problems with introduce my conditions in reality. If any good person coul help me a little bit, I would be very gratefull.  
How to convert these conditions below to code?

For example every candle is 1H candle->

-positions can be opened from e.g. 08:00:00 to 21:59:59
-body of candle #1 and candle #2 shoul have minimum e.g. 5 pips
-if at the actual moment there is no opened a position, then it can be opened only one position, becouse if one position is opened, second position can't be opened
-if position was opened in any candle and if this position will not close with TP or SL, then this position has to be closed at the end of this candle (close price this candle)
- if the one position was opened and closed in the same candle( 1H candle), then next position can't be opened in the same candle

Thank you  for any information.

To add comments, please log in or register