How to display an indicator in EA test mode

 

Hello,

I could not find a way to dynamically display MA line on EA chart in test mode. It only displays at stop test time. I tried to include Custom Indicator code in EA, but I get error "SetIndexBuffer function must be called from custom indicator". ObjectCreate might do the trick. Any other method?

Thank you!


 

Hi, marceco!

The only method that I know of is to save a template with your indicator first. Then as soon as tester opens a new window you right-click in it and load your template.

Regards,

Sergey

marceco:

Hello,

I could not find a way to dynamically display MA line on EA chart in test mode. It only displays at stop test time. I tried to include Custom Indicator code in EA, but I get error "SetIndexBuffer function must be called from custom indicator". ObjectCreate might do the trick. Any other method?

Thank you!


 

you can automize this by naming a templace default.tpl or with your "EA_Name".tpl

 

Save the template as tester and it will load with the tester.

 

to Viffer:

Beautiful! It works!

 

Thank you all. However, my EA also calls MessageBoxA(), and the template disappears when the message box shows up. I am now testing ObjectCreate(), without much success so far. Any other idea will be welcome.

 

Well, I could finally get an acceptable display using a routine like this:

t=iTime(NULL,0,0);
p=iMA(NULL,0,20,0,0,PRICE_CLOSE,0);
cnt++;
ObjectCreate("MAp"+cnt,OBJ_RECTANGLE,0,t,p,t,p);
ObjectSet("MAp"+cnt,OBJPROP_COLOR,Yellow);
ObjectSet("MAp"+cnt,OBJPROP_BACK, false);
ObjectSet("MAp"+cnt,OBJPROP_WIDTH,4);

Reason: