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

OPEN RANGE STRATEGEY for Amibroker (AFL)

Copy & Paste Friendly
_SECTION_BEGIN("Price1");
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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();


NewDay = Day()!= Ref(Day(), -1);
EndDay = (Day()!= Ref(Day(), 1));

DayH = TimeFrameGetPrice("H", inDaily, -1);	// yesterdays high
DayL = TimeFrameGetPrice("L", inDaily, -1);	//	low
DayC = TimeFrameGetPrice("C", inDaily, -1);	//	close
DayO=ValueWhen(NewDay,O,1);//Todays Open

GPUP=DayO>DayH;
GPDN=DayO<DayL;

GPUP=ExRem(GPUP,EndDay);
GPDN=ExRem(GPDN,EndDay);

Ingpup=Flip(gpup,endday);
IngpDn=Flip(gpdn,endday);



BT = Param("BreakoutTime",93000,09000,120000);
target = Param("Target in Percentage",2.5,0.1,10,0.1);

HighValue=HighestSince(newDay,H);
LowValue=LowestSince(newDay,L);

RangeHigh = ValueWhen(Cross(TimeNum() , BT), HighValue); 
RangeLow = ValueWhen(Cross(TimeNum() , BT), LowValue);

Buy = (Ingpup OR Ingpdn) AND  TimeNum() > BT AND TimeNum() < 150000 AND Cross(H,RangeHigh);
Short = (Ingpup OR Ingpdn) AND  TimeNum() > BT AND TimeNum() < 150000 AND Cross(RangeLow,L);

Buy= ExRem(Buy,newDay);
Short = ExRem(Short,newday);

Sell = Cross(H,RangeHigh*(1+target/100)) OR Cross(DayH,L)   OR TimeNum()>151500 ;
Cover = Cross(RangeLow*(1-target/100),L) OR Cross(H,DayL)   OR TimeNum()>151500 ;

Sell = ExRem(Sell,Buy);
Cover = ExRem(Cover,Short);



BuyPrice=ValueWhen(Buy,C);
ShortPrice=ValueWhen(Short,C);
CoverPrice=ValueWhen(Cover,C);
SellPrice=ValueWhen(Sell,C);



Long = Flip(Buy,Sell);
Shrt = Flip(Short,Cover);

SetPositionSize(100,spsShares);


Plot(RangeHigh,"Range High",colorYellow,styleLine| styleDots);
Plot(RangeLow,"Range Low",colorBlue,styleLine| styleDots);

PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorBlueGrey, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorBlueGrey, 0,L, Offset=-50);                      
PlotShapes(IIf(Buy, shapeHollowUpArrow, shapeNone),colorWhite, 0,L, Offset=-45); 
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorYellow, 0, H, Offset=40); 
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorYellow, 0,H, Offset=50);                      
PlotShapes(IIf(Short, shapeHollowDownArrow, shapeNone),colorRed, 0,H, Offset=-45);


PlotShapes(Sell*shapeStar,colorWhite,0,H,20);
PlotShapes(Cover*shapeStar,colorWhite,0,L,-20);
Back