How to make real time chart EA to run like a control point model?

 
How to make real time chart EA to run like a control point model? I mean in a real time chart, EA will run at each tick. how to program it to make a real time chart run like a control point model? skip the rest of tick & only run at the control point.
 
Сontrol point model is only virtual model for running back testing of EA. These control points are diffrence from real points in past and calculated if you don't have deep detailed history.
 
Rosh:
Сontrol point model is only virtual model for running back testing of EA. These control points are diffrence from real points in past and calculated if you don't have deep detailed history.


1) I still do not how control points work. how it separate into 12 point? If using hourly chart, is it run each 5 minute(60 minute/12 points)?

2) For every tick model. is it exactly same with real time data if using a full detail history data?

 

It is impossible since test useing simulated data generated by softwre based on real history data.

But in real time, only have price at some time and no price data or no data-change at some time, you can not use simulated data at real time in real world since only there are real price data at real time.

1) I still do not how control points work. how it separate into 12 point? If using hourly chart, is it run each 5 minute(60 minute/12 points)?

yes, 12 point data generated by softwre based on real history data of hours, but 12 point not same as real 5 min that time.

2) For every tick model. is it exactly same with real time data if using a full detail history data?

no, data generated through another mode by softwre based on real history data.

 
interesting !!

what do those control point are calculated from?
what kind of deep history?
 
would the following code block work for counting control points:
   static datetime last_tick = NULL;
   
   bool new_control = false;
   if (last_tick != NULL)
   {
      for (int m = 5; m <= 60; m += 5)
      {
         if (m < 60)
         {
            if (TimeMinute(last_tick) == m-1 && TimeMinute(TimeCurrent()) == m) 
            {
               new_control = true;
               break;
            }
         }
         else
         {
            if (TimeMinute(last_tick) == 59 && TimeMinute(TimeCurrent()) == 0) 
            {
               new_control = true;
               break;
            }         
         }
      }
      
   }
   
 
   if (new_control)
   {
        . . .
   }
   
   
   last_tick = TimeCurrent();

I started a new thread for the EA I'm working on that has this very same problem. Please review

Backtesting Control Points - What's the calculation ? What's the solution ?
'Backtesting Control Points - What's the calculation ? What's the solution ?'
 
You basically gave me the idea of subdividing the bar to only perform when a new interval from within that bar has been completed. This of it like this:

On a 1HR Chart, 60min/5min = 12 control points. or 60min/10min = 6 control points. In the article

Strategy Tester: Modes of Modeling during Testing

posted somewhere here on this forum they state that if theres no data on the smaller time frame they use 12 control points, hence 60min/5min = 12 control points. They also state that once data on the smaller time frame becomes available they use 6 control points, hence 60min/10min = 6 control points.

The code block I posted previously may not be the precise solution but it may be a step in the right direction. Basically, the variable "new_control" only becomes active if the tick passes to a new control interval.

ps. I'm expecting responses to this.
 
I replied here: https://forum.mql4.com/7046
One thread would be enough for this. The same issue is unclear in all these topics.
 
RussB #:
Sie haben mich im Grunde auf die Idee gebracht, den Takt so zu unterteilen, dass er nur ausgeführt wird, wenn ein neues Intervall innerhalb dieses Takts abgeschlossen wurde. Dies sieht folgendermaßen aus:

Auf einem 1-Stunden-Diagramm, 60 Minuten/5 Minuten = 12 Kontrollpunkte. oder 60min/10min = 6 Kontrollpunkte. In dem Artikel

Strategy Tester: Modes of Modeling during Testing

, der irgendwo hier in diesem Forum gepostet wurde, geben sie an, dass sie 12 Kontrollpunkte verwenden, wenn es keine Daten zum kleineren Zeitrahmen gibt, also 60 Minuten / 5 Minuten = 12 Kontrollpunkte. Sie geben auch an, dass sie, sobald Daten für den kleineren Zeitrahmen verfügbar sind, 6 Kontrollpunkte verwenden, also 60 Minuten/10 Minuten = 6 Kontrollpunkte.

Der Codeblock, den ich zuvor gepostet habe, ist möglicherweise nicht die genaue Lösung, aber möglicherweise ein Schritt in die richtige Richtung. Grundsätzlich wird die Variable „new_control“ nur dann aktiv, wenn der Tick auf ein neues Kontrollintervall übergeht.

p.s. Darauf erwarte ich Antworten.

Thank you for your code I've been looking for a code for a long time that will make the main program behave in every tick like in the control point.

Your code is the only one that has actually helped me so far.

There is only a small problem that this code does not open an order at real trading time, what could be the reason?

it would also be nice of you if you could develop us another code that shows even more similar results as Controll Point returns.

I am very curious about your feedback

Thank you very much

 
RussB #: On a 1HR Chart, 60min/5min = 12 control points. or 60min/10min = 6 control points. In the article
Just write the normal New Bar code using the M5 timeframe.
void OnTick(){
   static datetime M5curr=0; datetime M5prev=M5curr; M5curr = iTime(_Symbol, PERIOD_M5, 0);
   if(M5prev != M5curr) OnControlPoint();