Daily Moving Averages on 24/7 markets – like MTF

Forums ProRealTime English forum ProBuilder support Daily Moving Averages on 24/7 markets – like MTF

Viewing 3 posts - 1 through 3 (of 3 total)
  • #96013

    Hello,

    I am interested in writing a code that would gather the MA20 for DJI.

    I am using a short time frame (currently 30 min) and would want something like this:

    At the end of the day (16:00 New York Time – not midnight! so can’t use Dclose), get the MA20 (or the close at 16:00 for 20 previous days divided by 20)

    Is there an easy way to do this, as the MTF doesn’t seem to be ready yet for live IG accounts

    Thanks!

    P.S – I found a few threads like this below but they are using midnight time with DCLOSE

    https://www.prorealcode.com/topic/daily-moving-average-on-any-timeframe/

    #96018

    It is possible to code something that gathers the last 20 prices at a certain time and averages them. The resulting line will be stepped and not smooth or could be created with segments but these won’t update until the desired time has been detected.

    I’ll try to write something for you after my first cup of tea of the day!

    #96021

    The cup of tea got my brain more awake and I remembered that I did something similar a couple of days ago for someone.

    https://www.prorealcode.com/topic/daily-ma7-on-smaller-timeframe/#post-95735

    Just modify the code to increase the number of variables stored to 20 and then divided them all be 20.

    I would also change TIME to OPENTIME and use OPEN instead of CLOSE.

    1 user thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)

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