hello I am trying to migrate this indicator to an EA but I have not been able to with this part of the code:
//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+intOnCalculate(
constint rates_total, // amount of history in bars at the current tickconstint prev_calculated,// amount of history in bars at the previous tickconstdatetime &time[],
constdouble &open[],
constdouble& high[], // price array of maximums of price for the calculation of indicatorconstdouble& low[], // price array of minimums of price for the calculation of indicatorconstdouble &close[],
constlong &tick_volume[],
constlong &volume[],
constint &spread[]
)
{
//---- checking for the sufficiency of the number of bars for the calculationif(BarsCalculated(Fr_Handle)<rates_total || rates_total<min_rates_total) return(RESET);
//---- declaration of local variables int to_copy;
//---- calculation of the necessary amount of data to be copiedif(prev_calculated>rates_total || prev_calculated<=0)// checking for the first start of the indicator calculation
{
to_copy=rates_total; // starting number for calculation of all bars
}
else to_copy=rates_total-prev_calculated+3; // starting number for the calculation of new bars//---- copy newly appeared data into the arraysif(CopyBuffer(Fr_Handle,UPPER_LINE,0,to_copy,UpBuffer)<=0) return(RESET);
if(CopyBuffer(Fr_Handle,LOWER_LINE,0,to_copy,DnBuffer)<=0) return(RESET);
//----
LineUp();
LineDn();
string FAP=DoubleToString((FrUpPrice-Distanse*_Point),_Digits);
string FDP=DoubleToString((FrDnPrice+Distanse*_Point),_Digits);
int diap=int(MathRound((FrUpPrice-FrDnPrice)/_Point));
/* if(comment)
{
Comment("TimeFrame="+TF+
"\nPrice of the upper fractal ="+FAP+
"\nPrice of the lower fractal ="+FDP+
"\nFractal channel ="+string(diap)+"points");
}*///----ChartRedraw(0);
return(rates_total);
}
any idea for the lines to be drawn in an EA and not as an indicator? this is the complete code of the indicator:
what I am looking for is that when crossing one of the lines open an operation, for example if the current candle breaks the fractal above buy, if it breaks the fractal below sell
Hi, i am trying to
hello I am trying to migrate this indicator to an EA but I have not been able to with this part of the code:
any idea for the lines to be drawn in an EA and not as an indicator? this is the complete code of the indicator: