Hello,
I am using an external application to run each time buy signal is true,
however the file keeps on re executing when working with tick data.
i have used exrem and this problem isn't there when i do back testing on 1min data but on tick even if i scroll through chart the if conduction seems to be executing when when buy value is 0;
Would it be possible to add delay or a pause of 1/2mins after each trade.
_SECTION_BEGIN("Stochastic");
SetTradeDelays(1,1,1,1);
periods = Param( "Periods", 15, 1, 200, 1 );
Ksmooth = Param( "%K avg", 3, 1, 200, 1 );
Dsmooth = Param( "%D avg", 3, 1, 200, 1 );
myStochD=StochD( periods , Ksmooth, DSmooth );
myStochK=StochK( periods , Ksmooth);
Overbought=80;
Oversold=20;
Buy = Cross(myStochK, myStochD );
Sell = Cross( myStochD, myStochK );
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
_TRACE("Buy Conduction= " +Buy);
Plot( myStochD, "Stochastic %D"+_PARAM_VALUES(), ParamColor( "ColorD", colorRed ), ParamStyle("StyleD") );
Plot( myStochK, "Stochastic %K", ParamColor( "ColorK", colorGreen ), ParamStyle("StyleK") );
PlotShapes(IIf(Sell, shapeHollowDownArrow , shapeNone), colorRed);
PlotShapes(IIf(Buy, shapeHollowUpArrow , shapeNone), colorBlue);
if ( LastValue(Buy) == True )
{
ShellExecute("C:/Orders/run.exe","","");
}
_SECTION_END();