A request that was addressed to ProRealTime:
hi, I would have a problem with a code I’m trying to create. In my strategy I created a system with 4 major conditions, and 3 alternatives to the main condition, with 4 types of stop loss.
The code is as follows:
IF c1 AND c2 AND c3 c4 AND THEN
BUY 1 CONTRACT AT MARKET
STOP Ploss 30
ELSIF AND c5 c6 c7 AND THEN AND c4
BUY 1 CONTRACT AT MARKET
STOP Ploss 28
ELSIF AND c8 c9 c10 AND THEN AND c4
BUY 1 CONTRACT AT MARKET
STOP Ploss 24
ELSIF AND c11 c12 c13 AND THEN AND c4
BUY 1 CONTRACT AT MARKET
STOP Ploss 18
ELSE
ENDIF
the condition 4 would be an indicator equal for all.
I have created a main strategy with IF that comprises c1, c2, and c3 and c4, and 3 alternatives different from each other to the main one.
Now I want to ask if it is okay as it is set, or make a change?
in this way as it set the system takes into consideration only one such strategy c5, c6, c7, and c4 and stop Ploss 28 or takes them all together?
Suggestion for an anwser:
IF c1 AND c2 AND c3 AND c4 THEN
BUY 1 CONTRACT AT MARKET
Set Stop Ploss 30
ELSIF c5 AND c6 AND c7 THEN
BUY 1 CONTRACT AT MARKET
Set Stop Ploss 28
ELSIF c8 AND c9 AND c10 THEN
BUY 1 CONTRACT AT MARKET
Set Stop Ploss 24
ELSIF c11 AND c12 AND c13 THEN
BUY 1 CONTRACT AT MARKET
Set Stop Ploss 18
ENDIF
Hi, the suggestion for an answer is wrong. You must add AND C4 in/on(?) each ELSIF line, before THEN obviously.
If you’re a native English speaker as your flag suggests, you could thank me by telling me what is the correct expression: “in each line” or “on each line”? If you’re not, don’t bother :))
Cheers
OK, please stop laughing, I see now this is an automatically created post, so Henry “The Machine” is not likely to answer and improve my English 🙂