[Attachment(s) from jani.talikka@gmail.com [amibroker] included below]
Here's the code. You can drag it onto a price chart to display the moving average and the buy/sell signals.
If you comment out the plotshapes lines and the moving average plot line, uncomment out the stochastic or annualised volatility plot line to insert those indicators below your chart. It should look like the attached picture.
Open the code in an analysis window and you can run an explore to give all buy and sell signals.
/*20160402_BottomFishers*/// based on Perry Kaufman article http://m.futuresmag.com/2016/03/25/rules-bottom-fishers// coded by Jani Talikka// set timeframe to daily, run explorereturns = ( Close / Ref( Close, -1 ) ) - 1;annualized_volatility = StDev( returns, 20 ) * sqrt( 252 );period = Param( "Stochastic lookback period", 14, 5, 100 );stochastic = 100 * ( Close - LLV( L, period ) ) /( HHV( H, period ) - LLV( L, period ) );downtrend = C < MA( C, 100 );volatility_entry_level = Param( "minimum vol level for entry", 0.19, 0.01, 1, 0.01 );Buy = downtrendAND annualized_volatility > volatility_entry_levelAND stochastic < 15;Sell = annualized_volatility < 0.05OR stochastic > 60;buy = ExRem( buy, sell );sell = ExRem( sell, buy );if( Status( "actionex" ) == actionExplore ){signalColor = IIf( Buy, colorBrightGreen, IIf(Sell, colorRed, Null) );AddColumn( C, "closing price", 1.2, 1, signalColor );AddColumn( MA( C, 100 ), "100 day moving average of Close" );AddColumn( annualized_volatility, "annualized volatility" );AddColumn( stochastic, "stochastic" );Filter = Buy OR Sell;}PlotShapes( IIf( Buy, shapeSquare, shapeNone ), colorGreen, 0, L, Offset = -40 );PlotShapes( IIf( Buy, shapeSquare, shapeNone ), colorLime, 0, L, Offset = -50 );PlotShapes( IIf( Buy, shapeUpArrow, shapeNone ), colorWhite, 0, L, Offset = -45 );PlotShapes( IIf( Sell, shapeSquare, shapeNone ), colorRed, 0, L, Offset = -40 );PlotShapes( IIf( Sell, shapeSquare, shapeNone ), colorOrange, 0, L, Offset = -50 );PlotShapes( IIf( Sell, shapeDownArrow, shapeNone ), colorWhite, 0, L, Offset = 45 );Plot(MA(C, 100), "MA(Close, 100)", colorOrange, styleLine);//Plot (stochastic, "Stochastic with lookback " + period, colorblack, styleline);//Plot(annualized_volatility, "Annualized Volatility", colorRed, styleLine);
__._,_.___
Attachment(s) from jani.talikka@gmail.com [amibroker] | View attachments on the web
1 of 1 Photo(s)
Posted by: jani.talikka@gmail.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (7) |
Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? The Yahoo Mail app is fast, beautiful and intuitive. Try it today!
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
.
__,_._,___
EmoticonEmoticon