OnInit and OnTick never called when ea on offline chart - page 2

 
Talita Laura Bispo Da Silva:

Did you get the solution to this problem?

I am in 2018, and i have the same problem. Build a EA to work in a offline renko chart but it doesn´t work because onTick() and start() are not called.

Asked and answered at  № 2. What part of "It is the offline chart generator that has to post the message to refresh the chart." was unclear?

The post since February 3, 2014 (Build 600) equivalent of "post the message" is EventChartCustom

Fix the chart generator.
 
whroeder1:

Asked and answered at  № 2. What part of "It is the offline chart generator that has to post the message to refresh the chart." was unclear?

The post since February 3, 2014 (Build 600) equivalent of "post the message" is EventChartCustom

Fix the chart generator.
That's not the equivalent because you must use OnChartEvent in the offline EA instead of OnTick, but still a better method. 
 
milfordT:

I was able to get some period converter indicators online. and generate different time period offline charts

 ATM_P4L_PeriodConverter_I

ATM_Period_Converter_opt  

However I can't get my EA to run on these offline charts.

I can see the offline chart price moving so I assume they are getting price ticks. 

I put in print statements to see if OnInit or OnTick were being called and they are not.  I even tried stripping out all the logic excep for the print statements but I never see any of these prints happening in the log. 

Does anyone have a solution?

 

I had same issue.  After reading this blog, I got an idea, which at the moment seems to be working.

init()

{

    EventSetTimer(1);

}

deinit()

{

    EventKillTimer();

}



void OnTimer()

{

    ChartRedraw();

    RefreshRates();

    EventSetTimer(1);

    //I put this comment to see that it's working

    Comment(Seconds()+"  "+Bid);

    //** the rest of your code **

   return;

}