With the following Pad & Align Checker when running it just on the Explorer the Error Function activates but after some signals are shown in the Results list. Is it possible to have it so no signals are shown if the Error Function is activated (Pad & Align not checked)?
if (Status("action") == actionBacktest OR Status("action") == actionExplore)
{
if (Status("stocknum") == 0)
StaticVarSet("barCountZero", BarCount);
else
if (StrToUpper(Name()) != "~~~EQUITY")
{
barCountZero = StaticVarGet("barCountZero");
if (BarCount != barCountZero)
Error("Make sure Pad & Align is checked in Backtester Settings dialog. Set symbol to $XAO");
}
}
buySignal = C > 1; // testing
Filter = buySignal;
But then how would you know if Pad & Align has been checked or not? I want the error message to be displayed, just don't want any results displayed if Pad & Align is not checked.
if (BarCount != barCountZero)
{
Filter = 0; // display no results
Error("Make sure Pad & Align is checked in Backtester Settings dialog. Set symbol to $XAO");
}
In some instances, I want to be able to check that the Pad and Align is off so I hacked the code as follows. It works, but if anyone knows a neater or proper way to do it, please share:
if (Status("action") == actionBacktest)
{
if (Status("stocknum") == 0)
StaticVarSet("barCountZero", BarCount);
else
if (StrToUpper(Name()) != "~~~EQUITY")
{
barCountZero = StaticVarGet("barCountZero");
if (BarCount != barCountZero)
//Error("Make sure Pad & Align is checked in Backtester Settings. Set symbol to All Ordinaries ticker (eg .AORD)");//comment out to check pad and align is off
ThreadSleep( 1 );//comment out to check pad and align is on
else//comment out to check pad and align is on
Error("Make sure Pad & Align is turned off in Backtester Settings.");//comment out to check pad and align is on
}
}