pprofit

Viewing 10 posts - 1 through 10 (of 10 total)
  • #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.

    #76998

    If 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.
    #77000

    Thanks 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?

     

    #77002

    The value you will be using is the value at the close of the last candle so this will tell you what that was as an indicator:

     

    #77006

    I think I’ve got it now, thank you.

     

     

    #77007

    The 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.

    Not tested.

    1 user thanked author for this post.
    #77008

    That looks good thanks, but for some reason doesn’t appear to work.  Some signals are correctly placed; others not.

    #77009

     

    #77010

    With this:

    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

    Screenshot_1-14

    3 users thanked author for this post.
    #77013

    Thanks again.  I made a typo (1 instead of 14), but I undersatand your explanation.

Viewing 10 posts - 1 through 10 (of 10 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login