Drag and drop SL and TP in the tester. - page 5

 
khorosh:
Well, what's not to understand? TheCHARTEVENT_OBJECT_CLICK event works on a visual testing chart and ok, I don't need more to control an Expert Advisor in a visual testing mode. Why do I need to call Print from the event?)
On the contrary. There is something that is not clear to you. But never mind.
 
Dmitry Fedoseev:
On the contrary. There's something you don't understand. Oh, come on.
I agree, I am very far from being a professional. But the Expert Advisor controls on the visual chart work using theCHARTEVENT_OBJECT_CLICK event. I haven't used other events and can't say anything about them.
 
khorosh:
I agree, I am very far from being a professional. But buttons of expert control on visual chart test usingCHARTEVENT_OBJECT_CLICK event works. I did not use other events and cannot say anything about them.
Yeah, it's buzzing, so it works.
 
Dmitry Fedoseev:
Yeah, it's buzzing, so it works.

By the way, this test works in visual testing mode. This indicator must be placed in the tester's template, start testing an empty Expert Advisor template and click on the chart with the mouse.

//+------------------------------------------------------------------------+
//|                                                   TestOnChartEvent.mq4 |
//|                        Copyright 2016, MetaQuotes Software Corp.       |
//|                                             https://www.mql5.com       |
//+------------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
   if(id==CHARTEVENT_CLICK)
     {
      Comment(GetTickCount());
      Print(GetTickCount());
     }  
  }
//+------------------------------------------------------------------+
 
khorosh:

By the way, this test works in visual testing mode. This indicator must be placed in the tester's template, start testing an empty Expert Advisor template and click on the chart.

Where is theCHARTEVENT_OBJECT_CLICK identifier in your code?

I seeCHARTEVENT_CLICK, so the event with this identifier is designed to track the click on the chart, not on the graphical object.

 
khorosh:

By the way, this test works in visual testing mode. This indicator must be placed in the tester's template, start testing an empty Expert Advisor template and click on the chart with the mouse.

Testing (even in visual mode), i.e. working in the tester (even in visual mode) and visual testing chart are different things.

You do not call this indicator from an Expert Advisor, you put it on a visual testing chart. It does not work in the tester, but on the visual testing chart.

 
Anatoli Kazharski:

Where in your code is theCHARTEVENT_OBJECT_CLICK identifier?

If you put this identifier, you should also code the button in the test. We are talking about whether OnChartEvent works or not for visual testing, so it doesn't matter which event.
 
khorosh:
If you use this indentifier, you should also code the button in the test. We are talking about whether OnChartEvent works or not during visual testing, so it doesn't matter which event.
Not in visual testing, but in the tester. In the tester, both in normal testing and in visual testing, everything is the same and ChartEvent doesn't work there. But during visual testing there is a chart and ChartEvent works in the indicators.
 
khorosh:
If you set this identifier, you must also encode the button in the test. We are talking about whether OnChartEvent works or not during visual testing, so it doesn't matter which event.

You have already "grinded" so much here that you seem to be confused what is important to you and what is not.

In your speech, almost in every post, you were talking aboutCHARTEVENT_OBJECT_CLICK, but in the code you presented a different identifier. And suddenly it became not important at all. ))

 
Dmitry Fedoseev:
Not in visual testing, but in the tester. In the tester, both during normal and visual testing everything is the same, and ChartEvent does not work there. But during visual testing, there is a chart and ChartEvent works in the indicators.
I accept. From now on I will distinguish these things and will be more precise in presenting the essence of ChartEvent usage during testing).