cool no worries. You been a great help.
how can I get H1 TF value and store it in a M5 TF 1 reply
Looking for script - Change of trailing stop value 9 replies
iCustom Value with another value ? 8 replies
How to get an MA value of first indicators value? 2 replies
Could RSI value show most update value on eur/usd chart? 6 replies
//+------------------------------------------------------------------+
//| Testindi.mq4 |
//| |
//| |
//+------------------------------------------------------------------+
#property copyright ""
#property link ""
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 White
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
extern int barcount = 3000;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
double currentdiff = 0;
datetime lastCalculationTime;
double close1 = 0;
double close2 = 0;
bool calculationStarts = false;
double totaldiff = 0;
if (Time[0] > lastCalculationTime)
{
if (!calculationStarts)
{
close1 = Close[0];
lastCalculationTime = TimeCurrent();
calculationStarts = true;
}
else
{
close2 = close1;
close1 = Close[0];
currentdiff = close1 - close2;
totaldiff = totaldiff + currentdiff;
lastCalculationTime = TimeCurrent();
}
}
//// CHUNK OF NEW STUFF I PUT IN ////
Print("totaldiff" + totaldiff);
int counted_bars=IndicatorCounted(), limit ;
if(counted_bars>0)
counted_bars--;
limit=Bars-counted_bars;
if(limit>barcount)
limit=barcount;
for(int i=0;i<limit;i++)
{
ExtMapBuffer1[i] = totaldiff;
}
////------------/////
return(0);
}
//+------------------------------------------------------------------+ close1 = iClose(pair1,0,1); close2 = iClose(pair1,0,2); result1 = close1 - close2