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

High-Low_Zig peak for Amibroker (AFL)

Copy & Paste Friendly
_SECTION_BEGIN("High-Low_Zig");

High_Reversal_Line = ParamToggle("High_Reversal_Line"," OFF | ON", default=1 ); //default True
Low_Reversal_Line =  ParamToggle("Low_Reversal_Line", " OFF | ON", default=1 ); //default True
Cloud = ParamToggle("Cloud"," OFF | ON", default=1 ); //default True


High_Reversal_Percent = Param("High-Reversal-%",5,2,10,0.2); //default 5
Low_Reversal_Percent =  Param("Low-Reversal-%",5,2,10,0.2); //default 5

High_Reversal_Period = Param("High-Reversal-Days",22,5,65,1); //default 22
Low_Reversal_Period  = Param("Low-Reversal-Days",22,5,65,1); //default 22

High_Reversal_Value =  HHV(H,High_Reversal_Period) * (1 - High_Reversal_Percent/100);
Low_Reversal_Value = LLV(L,Low_Reversal_Period) * (1 + Low_Reversal_Percent/100);

Trend_UP = High > High_Reversal_Value;
Trend_DN = Low < Low_Reversal_Value;

/* After the signal is genrated, we trade the next day/bar @ open 
Remove the Comment when doing backtesting*/

SetTradeDelays(1,1,1,1);
BuyPrice = Open;
SellPrice = Open;
ShortPrice = Open;
CoverPrice = Open;

SetPositionSize(100000,1); // Fixed 1 LAC allocation for every trade

// Is it possible to get both the signals same day??
// Don't know, anyway lets take precaution
 
Buy  = Trend_UP AND (NOT Trend_DN);
Sell = Trend_DN AND (NOT Trend_UP); 

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

Short = Sell;
Cover = Buy;


// the plots for the graphs

Plot( C, "Close", IIf(Trend_UP,colorBlue,IIf(Trend_DN,colorRed,colorBlack)),styleBar|styleThick   ); 
myshape = Buy * shapeUpArrow + Sell * shapeDownArrow ;
PlotShapes(myshape,IIf(Buy,colorBlue,IIf(Sell,colorRed,colorWhite)),0,IIf(Buy, Low, High));

// the reversal lines 

Plot(High_Reversal_Value,"HRV",IIf(High_Reversal_Line,colorGreen,colorWhite), styleThick);
Plot(Low_Reversal_Value,"LRV", IIf(Low_Reversal_Line, colorOrange,colorWhite),styleThick);

// Plots a Cloud when signal is not exclusive i.e Both are True or Both are False
Cloud_High = IIf(High_Reversal_Value < Low_Reversal_Value, Low_Reversal_Value, High_Reversal_Value);
Cloud_Low = IIf(High_Reversal_Value > Low_Reversal_Value, Low_Reversal_Value, High_Reversal_Value);
Cloud_Color = IIf(NOT Cloud,colorWhite,IIf(Trend_UP AND Trend_DN,colorBrightGreen,IIf(NOT Trend_UP AND NOT Trend_DN, colorLightGrey,colorWhite)));
PlotOHLC(Cloud_Low,Cloud_High,Cloud_Low,Cloud_High,"",Cloud_Color);
_SECTION_END();
Back