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 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 | _SECTION_BEGIN ( "High-Low_Zig" ); High_Reversal_Percent = Param ( "High-Reversal-%" ,5,3,10,0.5); //default 5 Low_Reversal_Percent = Param ( "High-Reversal-%" ,5,3,10,0.5); //default 5 High_Reversal_Period = Param ( "High-Reversal-Days" ,22,10,65,1); //default 22 Low_Reversal_Period = Param ( "High-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 ; 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 )); _SECTION_END (); |