IF decisions using the order gain
Forums › ProRealTime English forum › ProOrder support › IF decisions using the order gain
- This topic has 7 replies, 4 voices, and was last updated 5 years ago by Alun.
Tagged: positionperf
Viewing 8 posts - 1 through 8 (of 8 total)
-
-
04/04/2019 at 10:21 AM #9546804/04/2019 at 11:42 AM #95469
The instruction POSITIONPERF(n) returns: The performance (ratio gain/cost of the position)
So in order to use it in a condition you can do:
123if positionperf(0) > 0 then//we are in gain!!endif04/05/2019 at 4:40 PM #9556104/05/2019 at 4:44 PM #9556204/05/2019 at 6:32 PM #95580You can do something like this:
123456789takeprofit = 1000if longonmarket and (close - positionprice) * countofposition > takeprofit thensell at marketendifif shortonmarket and (positionprice - close) * (0 - countofposition) > takeprofit thenexitshort at marketendifwhich will check at the bar close if you are in the desired profit or alternatively just use:
1set target $profit 1000which places an order on the market to sell when up $1000 or whatever currency the instrument is in.
04/05/2019 at 8:17 PM #95584When I have tried this it does not seem to work. I would like to exit greater than a gain value. Is this possible?
Yes just set your gain value as a percentage, for example …
123if positionperf(0) > 0.1 then //gain > 0.1%Sell at Marketendif04/06/2019 at 12:15 AM #9558804/06/2019 at 12:19 AM #95589 -
AuthorPosts
Viewing 8 posts - 1 through 8 (of 8 total)
Find exclusive trading pro-tools on
Similar topics: