Sample AFL Code - SuperTrend Intraday
This is a first version of Supertrend Intraday Strategy. Please highlight any issues with the code needs to be fixed or any additional features needs to be added. If it is worth doing then will add it accordingly. Code suits to run in 5.5+ version onwards. If you havent upgraded to the newer version then please consider upgrading as the new Amibroker has lot more features than the older one.Download Sample Code
Sample AFL Code - SuperTrend Positional
This is an upgraded version of Supertrend indicator. Supertrend is a carry forward strategy that involves overnight gapup/gapdown risk and also weekend carry forward risk. It is not a pure intraday strategy.Download Sample Code
Sample AFL Code - EMA Corssover
This is a simple prototype Amibroker AFL Code for those who want to design a level based breakout system when the technical event occurs(For example ema crossover, MACD crossing zero or RSI crossing above a certain threshold).Download Sample Code
Sample AFL Code - Lin Supertrend
Compared to Supertrend 3.0 with the new version two interesting features has been added. One is a simple EMA filter rule is added to Buy and Short Conditions and changes in the dashboard (included target levels in Supertrend Dashboard for discrete traders). And performance of Trading system is really interesting when comes to backtesting with Nifty and Bank Nifty Futures.Download Sample Code
Sample AFL Code - Supertrend V5
In the new version of Supertrend 5.0 thought of removing ATR factor to make the trading strategy independent of volatility factor. It is a simple long/short strategy fits for trading lower timeframes (5min, 10min, 15min) and strategy requires carry-forwarding the open position.Download Sample Code
Ultimate Volatility Expert
Sample AFL Code - Ultimate Volatility Expert
Ultimate Volatility Expert is a system created based on ADM(Average Daily Movement). It is a system based on breakout trading and quite similar to Open range breakout trading. And here the breakout levels are decided based on the ADM movement.Download Sample Code
ATR Volatility System
Sample AFL Code - ATR Volatility System
Another ATR Volatility based Long only Trading System. ATR Volatility system a mechanical strategy for higher time-frames Written by Tudor Marcelin – Art Invest. Just modified the actual trading system to support trailing stoploss based rather than channel based trading system and added back testing functionality.Download Sample Code
Camarilla Trailing Stops
Sample AFL Code - Camarilla Trailing Stops
Generally people use Camarilla as Pivot Point levels for their intraday trading. How about using Camarilla Pivot as Trailing Stop for positional trading. We build this interesting trading system (Prototype) using the concept limit order backtesting. It is a simple long/short breakout trading system with no optimization variables.Download Sample Code
Bollinger Band Trailing Stop Loss
Sample AFL Code - Bollinger Band Trailing Stop Loss
BBand TSL or Bollinger Band-based Trailing stop loss trading is once again a mechanical trend trading system for lower timeframes. The trailing stop-loss method is completely built using bollinger bands and completely fits for stop and reverse strategy.
1) The green line indicates a trailing stop for long
2) The Red line indicates a trailing stop for shorts
3) The Green Arrow indicates long
4) The Red Arrow indicates shorts
Line Pair Trading
Sample AFL Code - Line Pair Trading
Pair Trading is a neutral strategy which involves two stocks/indices with opposite positions at any given point of time to profit from any kind of market situations.Download Sample Code
AlphaTrend Trading Strategy
Sample AFL Code - AlphaTrend Trading Strategy
What is Alphatrend?
Alpha Trend tries to solve those problems such as:
1-To minimize stop losses and overcome sideways market conditions.
2-To have more accurate BUY/SELL signals during trending market conditions.
3- To have significant support and resistance levels.
4- To bring together indicators from different categories that are compatible with each other and make a meaningful combination regarding momentum, trend, volatility, volume and trailing stop loss.
Purposes of Alpha Trend:
1- Acts like a dead indicator like its ancestor Magic Trendin sideways market conditions and doesn’t give many false signals.
2- With another line with 2 bars offset off the original one Alpha Trend has BUY and SELL signals from their crossovers.
BUY when AlphaTrend line crosses above its 2 bars offset line
SELL when Alpha Trend line crosses below its 2 bars offset line
Range Filter Trading System
Sample AFL Code - Range Filter Trading System
Range Filter is a non-ATR-based trend-following strategy. Range Filter is an experimental study designed to filter out minor price action for a clearer view of trends. Here is the Amibroker Trend Following Strategy code based on the Range Filter.
How Range Filter is Calculated?
1) a smooth average price range is calculated for the basis of the filter and multiplied by a specified amount.
2) the filter is calculated by gating price movements that do not exceed the specified range.
3) the target ranges are plotted to display the prices that will trigger filter movement.
Open Range Breakout Trading System
Sample AFL Code - Open Range Breakout Trading System
Opening Range is very often a measure of security high and low generally monitored by breakout traders to gauge the sentiment of the market. The very often first 15-minute high – low range made by the stock/index is used as a reference by many traders to monitor for breakout trading.
A Simple Open Range Breakout Trading system is primarily useful for intraday traders who is looking for a price breakout from the opening range. Typically traders very often use a 15min / 30min opening range to monitor breakout with pre-defined stops/targets.
Features of Opening Range Breakout
1)Multiple ORB Breakout Selection of the Traders Choice
2)Limit the Number of Entry Signals per day
3)Intraday Trading System with signal starttime, endtime and squareofftime controls
4)Mode of Trading: i) No Stoploss/Target mode, ii)Fixed Point Stoploss/Target , iii)Fixed Percentage Stoploss/Target mode.
6)Trading Dashboard that tracks the Signals and Profit/Loss
Halftrend Trading System
Sample AFL Code - Halftrend Trading System
The Halftrend trading system is a technical analysis strategy that uses the Halftrend indicator, which is a custom trend-following indicator. It is designed to identify the direction of a trend and generate buy and sell signals based on the price action of an asset. The Halftrend indicator is based on moving averages and adapts to changing market conditions by adjusting its sensitivity. The strategy is typically used by swing traders and can be applied to various markets and timeframes.Download Sample Code
Kase Dev Stops V1
Sample AFL Code - Kase Dev Stops V1
Kase Dev Stops is a volatility-based stop and Dev Stops refers to the Standard Deviation-based Stops and uses ATR-based volatility. Kase DevStops provide a statistically sound basis upon which to place stop-loss and stop and-reverse orders.Download Sample Code