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 ....
Accumulative Swing Index (ASI) for Amibroker (AFL)
Rating:
0 / 5 (Votes 0)
Tags:
Accumulative Swing Index (ASI)
Accumulative Swing Index (ASI)
Indicator / Formula
Copy & Paste Friendly
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 ( "Accumulative Swing Index (ASI)" ); // Define parameters asiPeriod = Param ( "ASI Period" , 14, 1, 100, 1); maPeriod = Param ( "MA Period" , 50, 1, 200, 1); rsiPeriod = Param ( "RSI Period" , 14, 1, 50, 1); rsiOverbought = Param ( "RSI Overbought Level" , 70, 50, 100, 1); rsiOversold = Param ( "RSI Oversold Level" , 30, 0, 50, 1); volumeThreshold = Param ( "Volume Threshold" , 100000, 1, 10000000, 10000); // Calculate Swing Index prevClose = Ref ( Close , -1); K = Max ( H - prevClose, L - prevClose); SwingIndex = IIf ( H == L , 0, IIf ( Close > prevClose, (50 * ( Close - prevClose + 0.5 * ( Close - Open ) + prevClose - Open ) / K), (50 * ( Close - prevClose + 0.5 * ( Close - Open ) + prevClose - Open ) / K))); // Calculate ASI asi = Cum (SwingIndex); // Calculate Moving Average (filter) maValue = MA ( Close , maPeriod); // Calculate RSI (additional filter) rsiValue = RSI (rsiPeriod); // Buy and Sell Signals based on ASI and additional filters buySignal = Cross (asi, MA (asi, asiPeriod)) AND Close > maValue AND Volume > volumeThreshold AND rsiValue < rsiOversold; sellSignal = Cross ( MA (asi, asiPeriod), asi) AND Close < maValue AND Volume > volumeThreshold AND rsiValue > rsiOverbought; // Plot the price chart Plot ( Close , "Price" , colorBlack , styleCandle ); // Plot ASI Plot (asi, "Accumulative Swing Index (ASI)" , colorBlue , styleLine ); // Plot Moving Average Plot (maValue, "MA(" + maPeriod + ")" , colorRed ); // Plot Buy and Sell signals on the price chart Buy = buySignal; Sell = sellSignal; // Plot Buy and Sell arrows on the chart PlotShapes ( IIf ( Buy , shapeUpArrow , shapeNone ), colorGreen , 0, Low , Offset=-30); PlotShapes ( IIf ( Sell , shapeDownArrow , shapeNone ), colorRed , 0, High , Offset=30); // Add additional indicators for better visualization Plot (rsiValue, "RSI(" + rsiPeriod + ")" , colorLightOrange , styleLine ); Plot ( Volume , "Volume" , colorBlue , styleHistogram | styleOwnScale ); // Plot buy and sell signals on the indicator chart for reference PlotShapes ( IIf ( Buy , shapeStar , shapeNone ), colorGreen , 0, Low , Offset=-10); PlotShapes ( IIf ( Sell , shapeStar , shapeNone ), colorRed , 0, High , Offset=10); // Generate buy and sell signals Buy = ExRem ( Buy , Sell ); Sell = ExRem ( Sell , Buy ); _SECTION_END (); |
0 comments
Leave Comment
Please login here to leave a comment.
Back