I want to sell a long position if at any time after the buy, the stock reaches a price 2% below the low of the candle of entry. I thought about using (0,98*Tradeindex(low)) but that doesn’t work.
I think we have both got it slightly wrong Robert where the pending orders are concerned as mine only lasts one bar and yours it not placed on the first bar!
These two options might work better:
1
2
3
4
5
6
7
8
9
ifnotonmarketand(yourconditions)then
buy1contractatmarket
sl=low*0.98
sellatslstop
endif
iflongonmarketthen
sellatslstop
endif
or
1
2
3
4
5
ifnotonmarketand(yourconditions)then
buy1contractatmarket
sl=low*0.98
set stopplossclose-sl
endif
If it is a market with lots of gaps then the last option might not work so well.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue