Hi,
Good morning and hope you are in good health.
Please can you check the following code – the program does not like lines 12 & 17.
//BUYDAX01
Q = 0.5
Q3 = Q * 3
Q32 = Q3 * 2
OFFSET = 5.0
BUY Q PERPOINT AT MARKET
// If the above BUY is executed THEN to place a SELL pending order
If LongOnMarket THEN
SELL Q3 PERPOINT AT (TRADEPRICE - OFFSET)
ENDIF
// If the above SELL is executed THEN to place a BUY pending order
IF ShortOnMarket THEN
BUY Q32 PERPOINT AT (TRADEPRICE + OFFSET)
ENDIF
// Stops and targets : Enter your protection stops and profit targets here
Firstly OFFSET could not have a 1:1 ratio with price, so you’d better write it as
OFFSET = 5.0 * pipsize
Secondly TRADEPRICE is not known until a bar has elapsed since you last opened a position, thus it can be 0 the very first trade or the closing price of the previously closed trade.
patel_kaushik – Always use the ‘Insert PRT Code’ button when posting code in any future topics to make it easier for other to read/copy – as per the forum rules. I have tidied up your last post.