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

 
khorosh:
Nevertheless, I use this function to control EA with buttons and everything works, both in tester and in real life.

You are confusing green with salty

you are using

OBJPROP_STATE

State of the button (Pressed/Removed)

bool

In the OnTick() event.

 
pako:

You are confusing green with salty

you are using

OBJPROP_STATE

State of the button (Pressed/Removed)

bool

No, I don't. I use CHARTEVENT_OBJECT_CLICK.
 
khorosh:
And how do you test?

Created an expert,recorded it inOnChartEvent:

   Comment(GetTickCount());
   Print(GetTickCount());

Started visual testing. I click on the graphic, create inscriptions, click on them... no effect.

 
Dmitry Fedoseev:

Created an expert,recorded it inOnChartEvent:

Started visual testing. I click on the graphic, create inscriptions, click on them... No effect.

Can youpost the code withOnChartEvent in full.I'll see what's the difference with mine. By the way, I have buttons in indicator, not in Expert Advisor. Try to create a button in the indicator and useCHARTEVENT_OBJECT_CLICK.
 
khorosh:
And you canpost the fullcode withOnChartEvent. I'll see what's the difference with mine. By the way, I have buttons in indicator, not in Expert Advisor. Try to create a button in an indicator and useCHARTEVENT_OBJECT_CLICK.
Do you overlay this indicator on the visual test chart?
 
khorosh:
Can youpost the fullcode with theOnChartEvent. ...
#property copyright "*"
#property link      "*"
#property version   "1.00"
#property strict

int OnInit(){
   return(INIT_SUCCEEDED);
}

void OnDeinit(const int reason){
}

void OnTick(){
}

void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   Comment(GetTickCount());
   Print(GetTickCount());
}
 
Dmitry Fedoseev:
So it doesn't seem to be working. But make a button in the indicator and useCHARTEVENT_OBJECT_CLICK. It will work.
 
khorosh:
So it doesn't seem to be working. But make a button in the indicator and useCHARTEVENT_OBJECT_CLICK. It will work.
What to do with this indicator? Call it from the Expert Advisor or apply it to the visual testing chart?
 
Dmitry Fedoseev:
Do you overlay this indicator on the visual test chart?
Yes. In the tester template you can.
 
khorosh:
I swear to God). When a button on the tester chart is pressed, its colour changes. Could this be an indication thatOnChartEvent is working?
What does this have to do with the button? The button responds to pressing it, no problem here. You put some Print in the OnChartEvent and see if it doesn't work in the tester. Of course if you don't have OnChartEvent called manually from some class, I've seen such variants in articles on the site.