Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

OHLC Strategy for Amibroker (AFL)

Rating:
2 / 5 (Votes 6)
Tags:
amibroker, exploration, open, high

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.

Indicator / Formula

Copy & Paste Friendly
_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");
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();

1 comments

1. saachin
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("Brk Line");
H1 = TimeFrameGetPrice("H",inDaily,-1);
H2 = TimeFrameGetPrice("H",inDaily,-2);
H3 = TimeFrameGetPrice("H",inDaily,-3);
H4 = TimeFrameGetPrice("H",inDaily,-4);
H5 = TimeFrameGetPrice("H",inDaily,-5);
H6 = TimeFrameGetPrice("H",inDaily,-6);
H7 = TimeFrameGetPrice("H",inDaily,-7);

L1 = TimeFrameGetPrice("L",inDaily,-1);
L2 = TimeFrameGetPrice("L",inDaily,-2);
L3 = TimeFrameGetPrice("L",inDaily,-3);
L4 = TimeFrameGetPrice("L",inDaily,-4);
L5 = TimeFrameGetPrice("L",inDaily,-5);
L6 = TimeFrameGetPrice("L",inDaily,-6);
L7 = TimeFrameGetPrice("L",inDaily,-7);

du = Max(Max(Max(Max(Max(Max(H1,H2),H3),H4),H5),H6),H7);
dl = Min(Min(Min(Min(Min(Min(L1,L2),L3),L4),L5),L6),L7);

x = BarIndex();
x1 = (BarCount -1);
xL = SelectedValue(ValueWhen((Day()!=Ref(Day(),-1)),x,1));
yy = Status( "pxchartheight" ) ;

Plot(LineArray(xL,SelectedValue(du),x1,SelectedValue(du),1),"Up",colorBlue,styleThick|styleNoRescale);
Plot(LineArray(xL,SelectedValue(dl),x1,SelectedValue(dl),1),"Down",colorRed,styleThick|styleNoRescale);
_SECTION_END();

_SECTION_BEGIN("Hadley");
//Headley Band
length=Param("Length",20,0,10000000);
ub=(High*(1+2*((((High-Low)/((High+Low)/2))*1000)*0.001)));
su=MA(ub, length );
Lb=(Low*(1-2*((((High-Low)/((High+Low)/2))*1000)*0.001)));
sl=MA(Lb, length );
Plot(su, "HU", colorBlue,styleThick);
Plot(sl, "HL", colorBlue,styleThick);
//Plot((su+sl)/2, "", colorBlue);
_SECTION_END();

_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();


_SECTION_BEGIN("Explore");
pds= Param("Period",7,1,1000000);
du = HHV(Ref(H,-1),pds);
dl = LLV(Ref(L,-1),pds);
Cond1 = Cross(C,du);
Cond3 = Cross(dl,C);

Filter = Cond1 OR Cond3 ;
AddColumn(IIf(Cond1,1,Null),"B1",1.2);
AddColumn(IIf(Cond3,1,Null),"S1",1.2);
_SECTION_END();

Leave Comment

Please login here to leave a comment.

Back