Hi, I am trying to code a bot and it comes up with this syntax error wherein it indicates that BUY is incorrect. I am not sure what the problem may be and would welcome any suggestion on how to correct it.
thanks
| Indicator1 = close |
|
|
|
|
| Indicator2 = KS |
|
|
|
|
| Indicator3 = CS |
|
|
|
|
| Indicator4 = SA |
|
|
|
|
| indicator5 = ExponentialAverage[5](close) |
|
| c1=(Indicator1 > Indicator2) |
|
|
|
| c2=(Indicator1 > CS AND SA) |
|
|
|
| // Conditions to enter long positions |
|
|
| IF (c1 AND c2)THEN Buy possize CONTRACT AT MARKET |
| ENDIF |
|
|
|
|
|
It would be so much eaiser if you use the blue Insert PRT Code button on the far right of the message toolbar.
What are KS, CS and SA ?
possize = 1
Indicator1 = close
Indicator2 = KS
Indicator3 = CS
Indicator4 = SA
indicator5 = ExponentialAverage[5](close)
c1=(Indicator1 > Indicator2)
c2=(Indicator1 > CS AND SA)
// Conditions to enter long positions
IF (c1 AND c2) THEN
Buy possize CONTRACT AT MARKET
ENDIF
The problem was THEN, it cannot be followed by anything but comments on the same line.
GraHal’s correction works fine.