I like the Ichimoku indicator. Now I dont understand how to use the Future Cloud, it is the senkou span A (-26) and senkou span B (-26)... as you know, different to other indicators the Ichimoku is shifted 26 periods ahead of the current price.
//Here the (-26) indicates that I am using the cloud ahead
Now in MT5 a possible code would be:
#include <GetIndicatorBuffers.mqh>//---- arrays for indicatorsdouble Tenkansen[]; // array for TENKANSEN_LINE of iIchimokudouble Kijunsen[]; // array for KIJUNSEN_LINE of iIchimokudouble SenkouspanA[]; // array for SENKOUSPANA_LINE of iIchimokudouble SenkouspanB[]; // array for SENKOUSPANB_LINE of iIchimokudouble Chinkouspan[]; // array for CHINKOUSPAN_LINE of iIchimoku//---- handles for indicatorsint Ichimoku_handle; // handle of the indicator iIchimoku//+------------------------------------------------------------------+//| Expert initialization function |//+------------------------------------------------------------------+intOnInit()
{
//--- creation of the indicator iIchimoku
Ichimoku_handle=iIchimoku(NULL,0,9,26,52);
//--- report if there was an error in object creationif(Ichimoku_handle<0)
{
Print("The creation of iIchimoku has failed: Runtime error =",GetLastError());
//--- forced program terminatioreturn(-1);
}
return(0);
}
//+------------------------------------------------------------------+//| Expert tick function |//+------------------------------------------------------------------+voidOnTick()
{
//--- set indexation of arrays as timeseries//--- filling the arrays with current values of all indicator's buffers//--- return if there was an errorif(!GetIchimokuBuffers(Ichimoku_handle,0,100,
Tenkansen,
Kijunsen,
SenkouspanA,
SenkouspanB,
Chinkouspan,
true)) return;
}
But I am not sure if SenkouspanA[-26 ] will work, or yes??
Hello
I like the Ichimoku indicator. Now I dont understand how to use the Future Cloud, it is the senkou span A (-26) and senkou span B (-26)... as you know, different to other indicators the Ichimoku is shifted 26 periods ahead of the current price.
In old metatrade 4 it was like:
iIchimoku(NULL, 0, 9, 26, 52, MODE_SENKOUSPANA, -26)
//Here the (-26) indicates that I am using the cloud ahead
Now in MT5 a possible code would be:
But I am not sure if SenkouspanA[-26 ] will work, or yes??
Thanks in advance for any help.