Amibroker AFL code for OHOL Strategy

MarketSecrets - Learn To Trade Like a Pro

Amibroker AFL code for OHOL Strategy:

Script:

//This afl scan the list of Open=High AND Open=Low which is updated with Automatic TGT, SL AND previous Volume AND todays Volume with some other indicators value. This works good for intraday trading before 10:30 AM.//
_SECTION_BEGIN(“Open == High AND Open == Low Morning Exploration”);

DOpen = TimeFrameGetPrice( “O”, inDaily, 0 ); // gives you Todays Open price.
DHigh = TimeFrameGetPrice( “H”, inDaily, 0 ); // gives you Todays High price.
DLow = TimeFrameGetPrice( “L”, inDaily, 0 ); // gives you Todays High price.
PClose = TimeFrameGetPrice( “C”, inDaily, -1 ); // gives you Previous Day Close price.
YVol = TimeFrameGetPrice( “Volume”, inDaily, -1 ); // gives you Previous Day Volume.

Buy = Open == Low;

Sell = Open == High;

Noise = High > Close;
Noise = Low <= Close;

newday = Day() != Ref(Day(),-1); //check for the start of the day

opencond = newday AND (DOpen == DHigh OR DOpen == DLow);

Filter = opencond ;


colorstatus = IIf(newday AND DOpen == DHigh,colorRed,IIf(newday AND DOpen == DLow,colorGreen,Null));


AddColumn(IIf(newday AND DOpen == DHigh,DHigh,Null),”Open==High”,1.2,colorWhite,colorstatus);

AddColumn(IIf(newday AND DOpen == DLow,DLow,Null),”Open == Low”,1.2,colorWhite,colorstatus);

 

Sunil= ((1.5 * (Open-Close)) > (High-Low));
VDiff = (Volume/YVol);
ATP = (Open + High)/2;
Pivot = (PClose+Open+ATP)/3;

Target1OeqL = Open – (Open * 0.01);
Target2OeqL = Open – (Open * 0.015);

Target1OeqH = Open + (Open * 0.01);
Target2OeqH = Open + (Open * 0.015);

SL4OeqH = Open + (Open * 0.003);
SL4OeqL = Open – (Open * 0.003);

AddColumn(PClose, “Pclose”);
AddColumn(Open,”Open”);
AddColumn(High,”High”);
AddColumn(Low,”Low”);

//superbuy= pervious close=dopen=dlow
// super Sell= pcloswe=dopen=dhigh

AddTextColumn(WriteIf(Buy AND dopen == pclose, “YES”, “”), “Super Buy”);
AddTextColumn(WriteIf(Sell AND dopen == pclose,”YES”, “”), “Super Sell”);

AddColumn(IIf(Target1OeqL AND DOpen == DHigh,Target1OeqL,Target1OeqH),”Target1″,1.2,colorWhite,colorstatus);
AddColumn(IIf(Target2OeqL AND DOpen == DHigh,Target2OeqL,Target2OeqH),”Target2″,1.2,colorWhite,colorstatus);
AddColumn(IIf(SL4OeqH AND DOpen == DHigh,SL4OeqH,SL4OeqL),”StopLoss”,1.2,colorWhite,colorstatus);
AddColumn( ATP, “ATP”);
AddColumn(Pivot,”Pivot”);
AddColumn( EMA(C,20),”EMA10″);
AddColumn(Volume,”Volume”,1.0);
AddColumn(YVol ,”YVol”,1.0);
AddColumn(VDiff ,”VDiff”);
AddColumn( RSI(14), “RSI” );


_SECTION_END();

Download File

error: Content is protected !!