Metatrader 4

Producing a MetaTrader Indicator Phase by Phase



 

 

Get your login: http://bit.ly/2_Forex_Trendy

This is a abide by together video clip, taking an indicator strategy and creating the code to develop the indicator. The intention of the video clip is to demonstrate coding strategies, not to market the indicator which is just an example here.
[Edit] I have been inactive for some time performing on several new projects. Adhering to the comments to this video clip I have now posted the indicator for obtain on a new web site run by a single of my associates. You can uncover the obtain at

14 comments

  1. Excellent video, thank you!

    Reply
  2. Can I link a website/live data into an ea? I found an ea that buys and sells based on a plethera of technical analysis. They have live streaming suggestions for buys and sells, that change by the second, you can also pick your time frame, 1 min, 5, 30, 1 hr, 4 hr, daily weekly, monthly.

    Reply
  3. this is not enough please guide me how to code pop up menu same like in moving average indicator for selecting method and Apply to for selecting price component. Please code for sum indicator with it.

    Reply
  4. //+—————-————————————————+
    //| Trend Ribbon.mq4 |
    //| Copyright 2016, MetaQuotes Software Corp. |
    //| https://www.mql5.com |
    //+—————————————————————-+
    #property copyright "Copyright 2016, MetaQuotes Software Corp."
    #property link "https://www.mql5.com"
    #property version "1.00"
    #property strict
    #property indicator_chart_window

    #property indicator_buffers 4

    input int SignalMAPeriod = 5;
    input int FastMAPeriod = 13;
    input int SlowMAPeriod = 34;
    input ENUM_MA_METHOD MAMethod = MODE_EMA;

    double BufferFast[];
    double BufferSlow[];
    double BufferUp[];
    double BufferDown[];

    #define UpIndicator 0
    #define DownIndicator 2
    #define FastIndicator 3
    #define SlowIndicator 1

    //+————– ————————————————+
    //| Script program start function |
    //+—————————————————————-+
    int OnInit()
    {
    //—indicator buffers mapping

    SetIndexStyle(FastIndicator,DRAW_LINE,STYLE_DOT,1,clrFireBrick);
    SetIndexBuffer(FastIndicator,BufferFast);
    SetIndexLabel(FastIndicator,"Fast");

    SetIndexStyle(SlowIndicator,DRAW_LINE,STYLE_DOT,1,clrGreen);
    SetIndexBuffer(SlowIndicator,BufferSlow);
    SetIndexLabel(SlowIndicator,"Slow");

    SetIndexStyle(UpIndicator,DRAW_HISTOGRAM,STYLE_DOT,1,clrGreen);
    SetIndexBuffer(UpIndicator,BufferUp);
    SetIndexEmptyValue(UpIndicator,0.0);

    SetIndexStyle(DownIndicator,DRAW_HISTOGRAM,STYLE_DOT,1,clrFireBrick);
    SetIndexBuffer(DownIndicator,BufferDown);
    SetIndexEmptyValue(DownIndicator,0.0);

    //+—————————————————————-+
    return(INIT_SUCCEEDED);
    }
    //+————————————+
    //|custom indicator iteration function |
    //+————————————+
    int OnCalculate(const int rates_total,
    const int prev_calculated,
    const datetime &time[],
    const double &open[],
    const double &high[],
    const double &low[],
    const double &close[],
    const long &tick_volume[],
    const long &volume[],
    const int &spread[])
    {
    //

    int limit;
    double signalMa,
    fastMa,
    slowMa;

    if(rates_total<=SlowMAPeriod)
    return(0);

    limit=rates_total-prev_calculated;
    if(prev_calculated>0)
    limit++;

    for(int i=limit-1;i>0;i–)//alternative for(i=0,i<limit,i++)
    {
    signalMa=iMA(Symbol(), Period(),SignalMAPeriod,0,MAMethod,PRICE_CLOSE, i);
    fastMa=iMA(Symbol(), Period(),FastMAPeriod,0,MAMethod,PRICE_CLOSE, i);
    slowMa=iMA(Symbol(), Period(),SlowMAPeriod,0,MAMethod,PRICE_CLOSE, i);

    if(signalMa>fastMa && fastMa>slowMa)//trending up
    {
    BufferFast[i]=fastMa;
    BufferSlow[i]=slowMa;

    BufferUp[i]=fastMa;
    }
    else if (signalMa<fastMa && fastMa<slowMa)//trending down
    {
    BufferFast[i]=fastMa;
    BufferSlow[i]=slowMa;

    BufferDown[i]=slowMa;
    }

    }

    //—return value of prev_calculated for next call
    return(rates_total);
    }
    //+———————————————+

    Reply
  5. great voice

    Reply
  6. Does this video shows how to add an email option to an existing indicator ? If not , may anyone help please ?ps. the mt4 can send an alert to my email successfully it is just that some indicators doesn't have this option.

    Reply
  7. Cool video!!!
    Thank you for information!

    Reply
  8. thanks

    Reply
  9. This was really useful, thank you! Subscribed

    Reply
  10. Same problem here, (Build 950) Compiled ok, (pre-histogram) but when I insert the Indicator I get nothing on the chart unlike yours in your video at 14:42. Any ideas?

    Reply
  11. sorry buy i follow all your instructions and when I attach the indicator to the chart the platform freeze and i have to delete the indicator from the list.Any advise?

    Reply
  12. Thank you for sharing.
    Very well explained, do you have more to share?

    Reply
  13. metastock formula HHV(C,8) please mql4 code

    Reply
  14. Excellent Joe … Thank you!

    A good basic explanation about how the indicator is working and the "Buffers" … I would be very interested in how to display an arrow or icon on a chart to give some indication.

    e.g an Green Arrow pointing up if the current trend is up, or a Red Arrow pointing down if the current trend is down. Not an arrow on a Bar, but rather an arrow on the chart which is dynamic and displays the current state.

    Not sure if you're still doing these videos, since no-one else commented (and it's been 10 months since your first and last video) … anyway … cheers for this. 🙂

    Reply

Leave a Reply