Firstly OFFSET could not have a 1:1 ratio with price, so you’d better write it as
1
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.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.