Is there any way to test if an Expert or Indicator is being run in a Strategy Testing window?

 

I am trying to limit Sendmail, I have tried using isTesting().


Seems like a simple question, but I have not been able to find it.


Thanks

 
if( IsTesting() || IsOptimization() || IsVisualMode() )
{
  //your program is under Strategy Tester
}
else
{
  //your program called by Client Terminal
}
 
ukt:
if( IsTesting() || IsOptimization() || IsVisualMode() )
{
  //your program is under Strategy Tester
}
else
{
  //your program called by Client Terminal
}

That will work for Experts, but does not seem to function for Indicators you may have added to the visual mode of the strategy tester.


Any other thoughts?

 

Guess, I found your question confusing - title is about testing, post also mentions sendmail.

In a nutshell, indicators are not tested in strategy tester.

cannot run/select indicator for strategy tester running - Ctrl+R for Strategy Tester and only able to select EA's

fundamental differences between two.

use F1 in Terminal to view help on: Auto Trading — Strategy Testing

 

In your indicator code, try...


if( (TimeCurrent() - Time[0]) > (Period() * 60 ) ) RunningStrategyTester = true;


Compare the "current" bar time to the live Server time. If the difference is more than the time of a bar, you are testing.

 
phy:

In your indicator code, try...


if( (TimeCurrent() - Time[0]) > (Period() * 60 ) ) RunningStrategyTester = true;


Compare the "current" bar time to the live Server time. If the difference is more than the time of a bar, you are testing.

That would do it... Just had to think outside of the box... Danka

 
phy:

In your indicator code, try...


if( (TimeCurrent() - Time[0]) > (Period() * 60 ) ) RunningStrategyTester = true;


Compare the "current" bar time to the live Server time. If the difference is more than the time of a bar, you are testing.

is KISS solution but:

1. your reply says to me that terminal builtins do not accurately reflect programs runtime environment - if builtins are ok then...?

2. again, not 'get it' regards indicator program and strategy tester - where is the relationship?

Thank you

 

if( IsTesting() || IsOptimization() || IsVisualMode() )

These functions are for experts, not indicators.

 
phy:

if( IsTesting() || IsOptimization() || IsVisualMode() )

These functions are for experts, not indicators.


Thanking you for your kind indulgence [yet again :] and yes, I know that...

what I do not know is WHY I continually miss[read/interpret] most of the damn posts I get involved in.


Thinking am gonna reset my attributes mask to asking mode only.


catch ya later maybe?

Reason: