AmibrokerIndicatorsIntraday TradingSwing TradingTrading OpportunityTrading Strategy Code

Technical Gap Stock Scanner AFL

Just copy this afl code for Technical Gap Scanner in your Amibroker formula editor and you will get the list of stock which have technical gap.

DC = TimeFrameCompress( C,inDaily,compressLast );
DH = TimeFrameCompress( H,inDaily,compressHigh );
DL = TimeFrameCompress( L,inDaily,compressLow );
DLO = TimeFrameCompress( O,inDaily,compressOpen );
DC1 = TimeFrameExpand( Ref(DC,-1),inDaily,expandFirst );
DL1 = TimeFrameExpand( Ref(DL,-1),inDaily,expandFirst );
DH1 = TimeFrameExpand( Ref(DH,-1),inDaily,expandFirst );
DLO1 = TimeFrameExpand( DLO,inDaily,expandFirst );
DC2 = TimeFrameExpand( DC,inDaily,expandFirst );
Change = 100*(DC2-DC1)/DC1;
// GAP UP DOWN INDEX //
GapU = (DLO1-DH1)*100/DLO1; GapD = (DLO1-DL1)*100/DLO1;
Gap = IIf(GapU>0,GapU,IIf(GapD<0,GapD,Null));
Filter = V*C>10000000 AND !IsEmpty(Gap) ;
SetOption("NoDefaultColumns", True );
AddColumn( DateTime(), "Date",formatDateTime, colorBlack,colorDefault,150 );
AddTextColumn( Name(), "Full name",Null, colorBlack,colorDefault,150);
AddColumn(DC1,"P.Close",1.2,colorDefault,colorDefault,100);
AddColumn(DLO1,"Open",1.2,colorDefault,IIf(DLO1>DC1,colorBrightGreen,colorRed),100);
AddColumn(Gap,"Gap",1.2,colorDefault,IIf(Gap>0,colorBrightGreen,colorRed),100);
AddColumn(DC2,"CMP",1.2,colorDefault,IIf(DC2>DC1,colorBrightGreen,colorRed),100);
AddColumn(Change,"%Change",1.2,colorDefault,IIf(Change>0,colorBrightGreen,colorRed),100);

How To Trade Stocks With Gap

7 thoughts on “Technical Gap Stock Scanner AFL

  • Priyal Patil

    Sir showing below error please resolved thanks

    Error 701. Missing buy/sell variable assignments.
    The formula that you are trying to backtest does not contain proper Buy and Sell rules. Buy and Sell rules should be written as assignments as shown below:

    Buy = Cross( Close, MA( Close, 50 ) );
    Sell = Cross( MA( Close, 50 ), Close ) );

    For more details see Tutorial: Backtesting your trading ideas

    • This afl is to just provide the list of stock which are in gap up and down. So run it in exploration and you will get the list of stock.
      There is no buy sell rule so we cannot backtest it.

  • hi..tried to copy paste formula in amibroker but showing syntax error in lines 12 and 13..

    • I just updated the code and checked with Amibroker 6.3 now its ok.

  • Swetall S Shah

    Sir your technical scanner is showing error when I run it on line 13/14 – gapd Pls help rectify it. Thank you.

    • I just updated the code and checked with Amibroker 6.3 now its ok.

    • Jahidul hasan

      Is it possible market open time?if i explore market opening time data are not come correctly.but after market close that time explore result is ok.how can i get result market opening time.

Comments are closed.