I need the alert coding for 2% defference of gapup and gapdow when the market start

I need the alert coding for 2% defference of gapup and gapdow when the market start.

As per the above condition based on percentage it is not possible with tradescript on gapup and gapdown

It is possible to code the same in Amibroker.

//-----------------------------------------------------------------------------------------------
//
//  Formula Name:    Percentage change exploration
//  Author/Uploader: Neotrade Analytics Pvt Ltd 
//  E-mail:          [email protected]
//  Website          www.neotradeanalytics.com/algobase.neotradeanalytics.com
//
//-------------------------Summary of AFL-------------------------------------------------------
//This AFL produces exploration results when stock opens more than +/- 2% 
//----------------------------------------------------------------------------------------------

_SECTION_BEGIN("Percentage change exploration");
Plot( C, "Close", colorBlack, styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
Pricediff = 0;

TimeFrameSet(inDaily);
//Get daily open
dailyOpen  = Open;
dailyhigh = High;
dailylow = Low;
//Get previous day close
prevclose = Ref(Close,-1);

Pricediff =  dailyOpen - prevclose;
//Calculate the percentage
Percentdiff = (Pricediff/prevclose) * 100;

tradingalert = IIf((Percentdiff>=2), 1, IIf((Percentdiff<=-2), 1,0) );

Filter = tradingalert;

AddColumn(prevclose, "prevclose",1.2); 
AddColumn(open, "close",1.2); 
AddColumn(Percentdiff, "Percentdiff",1.2); 

TimeFrameRestore();
_SECTION_END("");

Please find the AmibrokerĀ afl code which provides results in exploration when run on all the stocks.

Regards

Vivith

yes dude!! we can only implement very limited amount of strategies using Trade Script !!The Easiest Programming Language for Traders but with languages like Python and R we have higher possibilities success!!!