Cheer for your answer but It's fixed. I know it's rare but the buffer represents the probability and works better calculating in more than one time frame and adding others.
Do not know if this can serve you ...
//+-----------------------------------------------------------------+
// | SARDOS.mq4 |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property show_inputs
#property indicator_color1 Aqua
#property indicator_color2 Red
#include <stdlib.mqh>
#poperty indicator_buffers 2 ;
double ExtMapBuffer1[255] ;
double ExtMapBuffer2[255] ;
double ExtParam1 = 100 ;
extern int Frame1, Frame2, Ratio ;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
// --- Indicator 0
SetIndexStyle(0,DRAW_ARROW) ;
setındexbuff (0, extmapbuffer1);
setındexarrow (0.159);
setındexemptyvalu A (0,0.0);
setındexdrawbeg the (0, extparam1);
// --- Indicator 1
SetIndexStyle(1,DRAW_ARROW) ;
setındexbuff (1, extmapbuffer2);
setındexarrow (1.108);
setındexemptyvalu A (1,0.0);
setındexdrawbeg (1, extparam1);
ArrayResize(ExtMapBuffer1, Bars ) ;
ArrayResize(ExtMapBuffer2, Bars ) ;
//---
return(INIT_SUCCEEDED) ;
}
//+------------------------------------------------------------------+
// | Custom indicator deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//----
//----
}
//+------------------------------------------------------------------+
//| Script program start 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 nCont = Ratio, m = 0 ;
//-------------------------------------------------------------------+
Properties // lines |
//-------------------------------------------------------------------+
for(int n=0;n< Bars;n++)
{
ExtMapBuffer1[n] = iSAR(NULL,Frame1,0.02,0.2,n ) ;
if( n != nCont )
{
ExtMapBuffer2[n] = iSAR(NULL,Frame2,0.02,0.2,m ) ;
}
else
{
ExtMapBuffer2[n] = iSAR(NULL,Frame2 ,0.02,0.2,m + 1 ) ;
nCont = nCont + Ratio ;
m = m + 1;
}
}
//+-----
return(rates_total);
}
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
So I want to plus the same indicator of 2 differents time frames and build new one.
I would apreciate any example or any help. There are too much information and is difficult to find that I want, but I'm sure I'm not the first who want to do something like this.
Thanks in advance.