Hello,
I would like to code the following strategy for PRO REAL TIME with PROREALCODE language, NOT MQL4:
CANDLE OF REFERENCE (COR) = Candle time according to time frame.
Example for Time Frame “1mn” : if COR = 0730 = candle from 07h30 to 07h31
Example for time frame “15mn”: if COR = 0700 = candle from 07h00 to 07h15
H = Highest point of Candle of Reference
L= Lowest point of Candle of Reference
FH price = Final High price = Highest point of Candle of Reference + X points
FL price = Final Low price = Lowest point of Candle of Reference – Y points
When COR is completed (example: at 07h31 if COR = 07h30) BUY STOP at FH price and SELL STOP at FL price are placed.
If market price reaches FH price, a buy order at market price is triggered with a TP equal to [H-L-Z] and a SL equal to [H-L-W]. SELL STOP ORDER previously placed at FL price is then canceled.
If market price reaches FL price, a sell order at market price is triggered with a TP equal to [H-L-Z] and a SL equal to [H-L-W]. BUY STOP ORDER previously placed at FH price is then canceled.
If any, closed open positions at TIMECLOSE.