Didn't work. When opening in Excel it says unknown file format and doesn't split the columns either. But if you don't specify a separator and don't specify a file extension, it also says unknown format, but the text is broken in columns...
Konstantin83: Didn't work. When opening in Excel it says unknown file format and doesn't split columns either. But if you don't specify a separator and don't specify a file extension, it also says unknown format, but the text is broken into columns...
Is it possible to create an indicator that will have a buffer line, e.g. close[] line and a comment at the top left? I tried to make a simple example so my terminal hangs
When will the #resource option be applied to the indicator files? Does anyone know? I would really like to combine the whole project into one .ex5 file.
MoneyJinn: When will the #resource option be applied to the indicator files? Does anyone know? I would like very much to combine the whole project into one .ex5 file.
They seem to have promised such a possibility, but did not say when.
Please explain why the second buffer (label2) is zero
#property indicator_chart_window#property indicator_buffers 2#property indicator_plots 2//--- plot Label1#property indicator_label1 "Label1"#property indicator_type1 DRAW_LINE#property indicator_color1 clrRed#property indicator_style1 STYLE_SOLID#property indicator_width1 1//--- plot Label2#property indicator_label2 "Label2"#property indicator_type2 DRAW_LINE#property indicator_color2 clrWhite#property indicator_style2 STYLE_SOLID#property indicator_width2 1//--- indicator buffersdouble ExtLineBuffer[];
double ExtLineBuffer2[];
int InpMAPeriod=13; // Period//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intOnInit()
{
//--- indicator buffers mappingSetIndexBuffer(0,ExtLineBuffer,INDICATOR_DATA);
SetIndexBuffer(1,ExtLineBuffer2,INDICATOR_DATA);
PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0.0);
//---return(0);
}
//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,
constint prev_calculated,
constint begin,
constdouble &price[])
{
//--- check for bars countif(rates_total<InpMAPeriod-1+begin)
return(0);// not enough bars for calculation//--- first calculation or number of bars was changedif(prev_calculated==0)
ArrayInitialize(ExtLineBuffer,0);
//--- sets first bar from what index will be draw
InpMAPeriod=20;
int i,limit;
//--- first calculation or number of bars was changedif(prev_calculated==0)// first calculation
{
limit=InpMAPeriod+begin;
//--- set empty value for first limit barsfor(i=0;i<limit-1;i++) ExtLineBuffer[i]=0.0;
//--- calculate first visible valuedouble firstValue=0;
for(i=begin;i<limit;i++)
firstValue+=price[i];
firstValue/=InpMAPeriod;
ExtLineBuffer[limit-1]=firstValue;
//ExtLineBuffer[i]=1;
}
else limit=prev_calculated-1;
//--- main loopfor(i=limit;i<rates_total && !IsStopped();i++)
ExtLineBuffer[i]=ExtLineBuffer[i-1]+(price[i]-price[i-InpMAPeriod])/InpMAPeriod;
ExtLineBuffer2[i]=ExtLineBuffer[i];
//--- return value of prev_calculated for next callComment(ExtLineBuffer[rates_total-1]);
return(rates_total);
}
//+------------------------------------------------------------------+
1) For some reason, the OnCalculate function has no problems with multiple buffers, where there are separate close, open, etc.
2) I would love to use it, but it fails to use the algorithm for calculation of moving averages which is described in the code above
ExtLineBuffer2[i] tried to assign different values including constants - always zero
When saving a csv file, the data is not split into columns. Even the script from the standard example outputs all the data in one column.
Specify the separator:
Specify the separator:
Didn't work. When opening in Excel it says unknown file format and doesn't split columns either. But if you don't specify a separator and don't specify a file extension, it also says unknown format, but the text is broken into columns...
There's more to do like that:
Is it possible to create an indicator that will have a buffer line, e.g. close[] line and a comment at the top left? I tried to make a simple example so my terminal hangs
Take the comment out of the loop - should make it easier.
When will the #resource option be applied to the indicator files? Does anyone know? I would like very much to combine the whole project into one .ex5 file.
Please explain why the second buffer (label2) is zero
1) For some reason, the OnCalculate function has no problems with multiple buffers, where there are separate close, open, etc.
2) I would love to use it, but it fails to use the algorithm for calculation of moving averages which is described in the code above
ExtLineBuffer2[i] tried to assign different values including constants - always zero