pprofit
Forums › ProRealTime English forum › ProOrder support › pprofit
- This topic has 9 replies, 2 voices, and was last updated 5 years ago by Real Pro.
-
-
07/29/2018 at 12:02 PM #76997
Hello,
If I use: pprofit = averagetruerange[14](close)
… can someone tell me how PRT calculates the profit level?
If the profit target is not met on the first bar (after buy cond is met), does it re-calculate the level using the new bar? Does it continue to do this with each new bar?
Many thanks.
PS/ notify of follow ups via email sometimes doesn’t work.
07/29/2018 at 12:16 PM #76998If you are using SET to set the level then any time SET is read in the code then an order is sent to market and if the value is different to the previous level then it will be set at the new level. If your SET instruction is within an IF THEN ENDIF and the conditions are not met then it may not be updated.
1 user thanked author for this post.
07/29/2018 at 12:59 PM #77000Thanks Vonasi,
The backtest works better if I use SET, so I will go with that. Now I’m trying to get my indicator to match the backtest.
If the backtest says: set target pprofit = averagetruerange[14](close)
…could you tell me how to draw this as a dynamic line as an indicator please? Is it possible?
07/29/2018 at 1:15 PM #7700207/29/2018 at 1:52 PM #7700607/29/2018 at 2:18 PM #77007The problem with that is that is that the indicator is constantly updating on the current forming candle and so you will need to see if your conditions were met on the last candle and then set the closepricewhenbuy to the open value of the current candle and the ATR value to the previous candle to get a true picture of the trade.
123456789buycond = (buy conditions)if buycond[1] thenclosepricewhenbuy = openendifatr = closepricewhenbuy + averagetruerange[14](close[1])return atrNot tested.
1 user thanked author for this post.
07/29/2018 at 2:56 PM #7700807/29/2018 at 3:10 PM #7700907/29/2018 at 3:30 PM #77010With this:
1averagetruerange[1](close)you are just getting the currently forming ATR for a period of 1 so just this currently forming bar. That is not information that you can use in a strategy. My last version works exactly as it should be.
In this image the bottom indicator is showing AVERAGETRUERANGE[14](close[1]) which is the value a strategy would get at the close of a bar when it makes its decision. The OPEN of the current bar is the price you would open your trade at. Added together we get your take profit price which is shown in the top indicator which is my code.
OPEN + AVERAGETRUERANGE[14](close) = ?
63863.9 + 1379.14356 = 65243.04536
07/29/2018 at 3:46 PM #77013 -
AuthorPosts