display reason entry & exit in the order list
Forums › ProRealTime English forum › ProRealTime platform support › display reason entry & exit in the order list
- This topic has 6 replies, 4 voices, and was last updated 5 years ago by Nicolas.
-
-
04/29/2019 at 1:09 PM #9733504/29/2019 at 1:59 PM #97342
from a backtest to display why the trade exits
Sounds good! I’m intrigued.
What would be an example reason?
04/29/2019 at 3:04 PM #97346The reason why a strategy exits is always the same – because your strategy sent an order to the market!
The easiest way to find out which order is to run a back test version of the strategy which sets a flag every time an exit condition is met and then GRAPH the result.
12345678c1exit = 0if longonmarket and c1 thenc1exit = 1sell at marketendifgraph c1exitFor pending orders you have to work out if they were hit.
12345678sell at exitprice limitpendingsellexit = 0if longonmarket and high > exitprice thenpendingsellexit = 1endifgraph pendingsellexitIf you use SET TARGET PROFIT then you need to similarly check to see if your exit price was ever hit.
To make it more accurate you really need to include some sort of spread in the calculations.
04/29/2019 at 4:01 PM #97348In the charts I can see why it exits and your suggestion is also nice!
But the purpose for the request is to have it displayed in the orderlist, just like the built-in exit profit/stoplos/trailing are displayed.
If the strategy has 6 custom reasons to exit, those reasons would be nice to have a name in the orderlist. Not just “exit”.
Although something minor I still thought worth mentioning.
04/29/2019 at 4:13 PM #97353But what if you had 100 reasons to exit? What if 50 of these reasons to exit were true at the time of exit? Would they need to add 100 columns? How would they know what conditions were met without you coding something into each strategy to say this is reason 1, this is reason 2…… this is reason 100?
Often when I code a strategy I will add code that counts how many exits can be allocated to each reason and how much profit each reason would have made. This helps you see how over optimized each exit is.
1 user thanked author for this post.
04/30/2019 at 8:01 AM #9738305/09/2019 at 9:58 AM #98042 -
AuthorPosts
Find exclusive trading pro-tools on