Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

EMA Crossover High-Low Breakout Strategy – Amibroker AFL Code

1 min read

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).

System is designed in such a way that when a bullish technical condition occurs that high of the candle price will be used for buying price reference and when bearish condition occurs that low of the candle price will be used for selling price reference.

Long Condition

Short EMA = 13 EMA
Long EMA = 34 EMA

Look for Long Opportunity on the Positive EMA Crossover.
When the EMA Crossover happens, use the high of the candle as a buying reference and enter Buy on the breakout of the EMA candle crossover high reference.

Exit Long Condition

Look for Long Exit on the Negative EMA Crossover.
When the EMA Crossover crossover happens, use the low of the candle as selling reference and exit long on the breakout of the EMA candle crossover low reference

Interested in Designing your own trading systems?
It is a comprehensive Amibroker AFL Programming course in the internet designed for non-programmers who want/willing to design their own trading logic, indicators, buy or sell trading systems, trading dashboard & trade automation.

The course starts rights from scratch explaining Amibroker features, functionalities & capabilities of amibroker and explores in-depth into Amibroker AFL programming which brings creative ideas to the traders, make them independent in converting trading ideas into amibroker afl coding logic.

Enroll Now

Amibroker AFL Code for the Simple EMA Crossover High-Low Breakout System.

https://gist.github.com/99388aa49aca1855ea02d57ece406b4e

Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

[Live Coding Webinar] Build Your First Trading Bridge for…

In this course, you will be learning to build your own trading bridge using Python. This 60-minute session is perfect for traders, Python enthusiasts,...
Rajandran R
1 min read

[Webinar] Understanding and Mitigating Curve Fitting in System Trading

"Understanding and Mitigating Curve Fitting in System Trading"! This dynamic session aims to equip novice to intermediate traders, quantitative analysts, and financial engineers with...
Rajandran R
1 min read

P-Signal Strategy Long Only Strategy – Amibroker AFL Code

This tutorial provides an overview of the P-Signal reversal strategy, a quantitative trading strategy that utilizes statistical parameters and error functions to generate probabilistic...
Rajandran R
2 min read

4 Replies to “EMA Crossover High-Low Breakout Strategy – Amibroker AFL Code”

  1. Sirji

    Can you please help me to make available the following condition AFL as well as stock scanner.

    BUY = EMA 5 crossing above EMA 20 with RSI above 60 and awesome > 0 and volume > previous candle
    SELL = EMA 5 crossing below EMA 20 with RSI below 40 and awesome previous candle

    I Hope you will help me.

    Thanks a lot.

    Awaiting for your response

  2. Sir,
    I was searching over internet to find *linear regression forecast/curve* afl but didn;t find anywhere.Some versions are not satifactory or true which can be said to be LRF.Also its difficult to code not simple,can u provide the same and give insight on whether we need to define custom indicator code again in afl or we can call it in from file and use like mt4(icustom).How to work with different custom indicator based system in your next blog post.

  3. Hey Hi Rajendraan, This AFL, breakout is repainting, when two alternate candle crossover happened
    please chk

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More