Horizontal off set on the moving average in a automated strategy

Forums ProRealTime English forum ProBuilder support Horizontal off set on the moving average in a automated strategy

  • This topic has 9 replies, 4 voices, and was last updated 7 years ago by avatarTJM.
Viewing 10 posts - 1 through 10 (of 10 total)
  • #4782

    Hello

    I trade the top 40 share index in South Africa and I like to shift horizontally the faster moving average to the left by -1. This seems to give me better entry signals. On the chart one can offset the moving average horizontally easily. So I wanted to write a automated  strategy using this but as soon as I try to use the horizontally shifted moving average it does not exist as a usable  option. Does anyone know if it is possible to shift the moving average horizontally to the left by -1  in an automated strategy and if yes could you share the code with me please.

    Thanks

    Ian

     

    #4793

    Hello IGOSNELL

    Shifting moving average into the past is easy. If I understand well what you want to draw, here is the code : (just use the past value of the moving average you wish to shift)

     

    See screenshot attached below.

    #4818

    Thank you Nicolas

    I will try the code tonight when I get home, thanks once again.

    Regards

    Ian

     

    #4862

    Hello Nicolas

    I tried what you said but it will only allow a positive integer within the brackets which actuals shifts the moving average curve to the right I wanted to move the moving average horizontally to the left but it will not accept a negative number within the []. One can shift the moving average horizontally to the left on the normal chart but how does one code it I am not sure.

    Any other ideas?

     

    Regards

    Ian

    #4901

    Sorry, but I dont understand. What i’m doing in my example is the right manner to draw at each bar the value that were at N period before this bar.

    Maybe you want to draw something like the Chikou of Ichimoku? If so, maybe there is something I can do, tell me then.

    #4902

    Ok maybe I am not explaining my self properly : I would like to shift the moving average horizontally to the left as per the screen shot attached, but just don’t know how to code it.

    I believe the screen shot attached will help explain.

     

    Regards

    Ian

     

    #4927
    Kit

    Hi Ian (and Nicolas), I think the problem is what is known as future leak, that is trying to use something that is properly only available in the future.  By shifting an MA to the left, no value is available on the current bar- this may work in backtesting by hand, but can’t in real time!

    Cheers, Kit

    #4929

    It is not possible to achieve this, because PRT doesn’t make loop back in the past. Only indicator built in can do it. Sorry.

    #5007

    Thanks makes sense. To bad, its a pity since it does seem to work well for trading entry  signals whilst trading in real time.

    #18494
    TJM

    Hi, I just came across this discussion, because I’m looking to use an MA, shifted to the right (projected in the future).

    Does anyone know how to code this?

    Thanks

    T

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