With this strategy:
DEFPARAM CumulateOrders = false
IF close > open THEN
BUY 1 CONTRACTS AT MARKET
ENDIF
IF Macd[12,26,9](close) > 0 THEN
SET TARGET pPROFIT 30
SET STOP pLOSS 15
BUY 1 CONTRACTS AT MARKET
ENDIF
SET TARGET pPROFIT 20
SET STOP pLOSS 10
(1) – both conditions are true within the SAME bar, does ProOrder enters only 1 trade or 2, despite
DEFPARAM CumulateOrders = false
?
(2) – if and when the first condition is true, do SL and TP are set according to the two last lines, despite they are set before within
IF ... ENDIF
?
Thanks.
Remember that code is read from top to bottom, so it will only be the first condition to be true that will launch the only one allowed trade by CumulateOrders=false.
About your point ‘2), sorry I don’t understand. If the set stop and set target are written at the bottom of the code, without been nested into a conditional statement, they will be read and executed by the server for the order launched some lines before.. Am I clear? 🙂