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 ....
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
High-Low_Zig peak for Amibroker (AFL)
Copy & Paste Friendly
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | _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 (); |