Moving Average Daily

Moving Average Daily

At this stage ProRealtime doesn’t have multi timeframe capabilities. However one easy possibility is to use the moving average of the daily timeframe with the options of DOpen, DHigh, DLow, DClose and that’s what this indicator enables you to do. You can select the number of periods ie. Days: number of periods/days (please note there’s a limit depending on the timeframe you use this on and there’s a difference between PRT and IG data periods) open/high/low/close, etc… If you are going to use this in a live trading account you will need to set: DEFPARAM Preloadbars = Here is the table of how much Preloadbars you will need depending how many periods you want to look back.  The column max days shows the maximum of what you can set Preload to.

As an example of you are using a 10 minute timeframe the maximum DEFPARAM Preloadbars = 5000 // maximum is 5000 and this is equal to the moving average of 35 days.

DEFPARAM Preloadbars =
60 24 5000
Minutes bars per hour bars per day max days
1 60 1440 3
5 12 288 17
10 6 144 35
15 4 96 52
30 2 48 104
60 1 24 208

You should find this indicator useful if you are trading mean reversion system and want to make an entry a timeframe less than the daily while using the daily moving average as the mean.

REMINDER: if you want the indicator to appear in the Price section of the chart, you must add it by clicking on the spanner icon on the little Price tab in the Price window.

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Nicolas • 12/20/2016 #

    Thanks a lot, a lot of people will find it useful!
    About customclose of the daily OHLC, you could have compute them this way: (totalprice for instance)
    LMA = ((DOpen(i)+DHigh(i)+DLow(i)+DClose(i))/4) + LMA
     

  2. David • 12/20/2016 #

    Unfortunately the PRT is unreliable. 
    I made a simple 7 day moving average crosses over 30 day moving average but Pro Realtime opens position even though there’s no cross over.
    I tried to provide a screenshot but I keeping getting a HTTP error.

    • Nicolas • 12/20/2016 #

      Did you change trading hours or weekends data of the tested instruments? Calculate the daily moving average like the author do it in this code means a lot of preloaded bars, did you adapt this parameter correctly? 

    • David • 12/20/2016 #

      Nicolas, I wrote the code and I have DEFPARAM Preloadbars = 3000 on m60 so that’s plenty of preloadbars.
      As far as I know I didn’t change the weekend data of FX. But the drawn moving average lines do not cross many times but the position open and they should not open. So no one else is having this issue?
      I am running the Demo of 10.3 via IG so maybe that’s having an issue?
       

    • Nicolas • 12/20/2016 #

      How do you call this indicator in you trading strategy code? Did you make a CALL? Have you tried to GRAPH the returned variables of the indicators while backtesting?

    • David • 12/20/2016 #

      I’m using the call function. I checked again and it seems okay now on Demo and Live testing. Luckily I took a screen shot otherwise I wouldn’t believe that there was an entry issue as per my initial comment. 

  3. David • 12/20/2016 #

    Nicolas I’ve looked at it again and there’s a problem. 
    As an example here’s a simple cross over system and you can see the entry and exit is not at the cross over. It’s even worse if you use <> for the daily moving averages for the BUY. I made 2 instances of the indicator and Call the indicators Moving Average Daily with DHigh and DLow. I’m still having HTTP error when trying to upload a screen shot. Here’s a screenshot https://ibb.co/na7LDv 
    I look forward to hearing what results you have Nicolas. 
     
    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated

    // Conditions to enter long positions
    indicator1 = CALL \"Moving Average Daily HIGH\"[14]
    indicator2 = CALL \"Moving Average Daily LOW\"[50]
    c1 = (indicator1 CROSSES OVER indicator2)

    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    // Conditions to exit long positions
    indicator3 = CALL \"Moving Average Daily HIGH\"[14]
    indicator4 = CALL \"Moving Average Daily LOW\"[50]
    c2 = (indicator3 CROSSES UNDER indicator4)

    IF c2 THEN
    SELL AT MARKET
    ENDIF

     
     
     

    • Nicolas • 12/20/2016 #

      You’ll need to preload bars to get the good calculations of you indicators. I did not test it myself though. 

  4. David • 12/20/2016 #

    Nicolas I tried DEFPARAM Preloadbars = 5000
    And still the same drawn output of entries/exits not at the drawn Cross Over  around 2 days earlier than the drawn Cross Over /Cross Under. 

  5. marcara • 12/20/2016 #

    Hi, Thank you very much for the Moving Average Daily indicator, I am using it as indicator in an intraday chart so I would like to preload bars. I tried to add at the beginning DEFPARAM CalculateOnLastBars = 5000 but it seems that it is doing nothing. If I use DEFPARAM Preloadbars = 5000 it claims that it is only used in Probacktest. Thanks in advance

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar
Related users ' posts
Leo Hi all, I posted a new version of this indicator ( I just add arrows to spot the local maxi...
Trading_En_El_Ibex35 Muchas Gracias por compartir este interesante indicador. Un saludo
xavieralava hola gracias leo
Khaled Thanks, but if I may ask what's EMA Period? The price which reverses the EMA[20] is not the ...
Francesco78 EMA is not a moving average, it is just the name we called the quantity defined above
Khaled My bad. Thank you so much!
rejo007 hello david, i'll try it could you tell me wich strategy do you use in real? thanks
David Somogyi Hello, I have a couple of DAX strategies of breakout and mean reversion. I'll try to post...
Roberto Blázquez Hi David, I just saw your strategy and it's good!!! I'm going to try it from today in real a...
Thomas007 Is there any way to build something similar for FX? I wonder what would be the replacement f...
Kris75 Hi Bolsatrilera, I love this indicator! Thanks; => did you develop a strategy around...
Nicolas No sorry, please use this file instead into a prorealtime trading platform.
rdabbs I just installed this indicator. It opens in its own pane rather than overlaid on the chart ...
Nicolas Just apply it on your price chart instead and you're ok.
Wilko I am not familiar with the screener function, but I am quite certain it should be quite simp...
Gubben @Wilko have you had a look at this again since MTF support? Heard you talk on Börssnack btw..
Wilko @Gubben not really. It was something I posted to show that simpler is usually better. Hope y...
DANY overfit
fatlung Excuse me. I would like to the time zone applied to this strategy.
UkCoopDownUnder Hi, ProOrder does not recognise, "avfullnessthreshold" any ideas, thanks
KarlBenjamin This "indicator" alone has completely changed my algorithms for the better! Id even go as fa...
ashee CAN YOU SHARE MT4 FILE
coyP Big thanks ! Can you explain me how can I put this ON my graph and not under the graph please ?
Wing There's a few threads on the forum about backtest and live trades being different at times. ...
ET I agree with verdi55. As it is now, the code will only test for a breakout on the upside (li...
Philipjonasson are u still active Wing?
diegofe_2000 cordial saludo NICOLAS , gracias por excelente indicador. ¿ es posible obtenerlo en MT4 ? ...
Nicolas Lo siento, pero no estoy trabajando para ayudar a la gente aquí de forma gratuita para promo...
diegofe_2000 Nicolas , gracias por tu atención. La pregunta era por curiosidad (yo no trabajo ni manejo ...
Nicolas We do not offer free assistance for TOS. However, you can send demand for private paid codin...
phanz Hi community. May I know how you use this indicator please? Is it on the zero cross over? ...
sydney43025 Hello, I'm digging up this topic because I uploaded the code on a PRT v11.1 but the indicato...
David Balance thanks for sharing this excellent indicator.  Here are some thoughts.  please ad...
supertiti Il manque 2 slash devant len dans le code dur car la variable ne marche pas bonne journée
larmhen
7 years ago
HerveS_67 Bonjour, A quoi correspondent les données S, M, L ? Hello, What do the data S, M, L?
Vinks_o_7 aux paramètres à rentrer : 5 20 et 200...
Maxime Baudin Nice, thanks!
rowestock Hi Nicolas, I am revisiting this indicator and wanted to ask, is it possible to replace sty...
Nicolas Why not, please add a new request in our probuilder forums.
majid52026 Hi I want MBXF Timing for mq5 Does anyone have this indicator???
dertopen Hi Nicolas good work for the code translation when i chek the mbfx system site i see in t...
Nicolas Yes, just change the color by yourself in the indicator settings window.
bearbull As per PhilipSchultz question above, has anybody managed to add code for when it turns blue,...
Ybr35 Bonjour Nicolas, lorsque je lance l'indicateur, il m'est indiqué que je dois définir les var...
Nicolas L'idéal est de télécharger le fichier itf joint sur cette page et de l'importer dans la plat...
JanWd Thank you for the coding, it seems promising. FTSE gives for the short term (5 min) promis...
Jan Wind 21.04.2019: I retested the strategy for the DAX 5 minutes , it works fine for 10.000 bars, b...
bertrandpinoy hello Francesco, are you still working on this strategy?
Nicolas Merci dans ce cas d'ouvrir un sujet dans le forum ProScreener svp.
Andrea Hi Nicolas, thx for your code. Please i need your help to understand this part of your code:...
Nicolas the MA200 is ascending since 20 periods.

Top