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 and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

Internal Bar Strength – Mean Reversion Trading AFL code

39 sec read

IBS Mean Reversion System

Here is a simple mean reversion system adapted from IBS reversion edge with QuantShare. And our IBS mean reversion strategy is a slight variation of the Internal Bar Strength by taking a three day moving average to IBS (maIBS) and looking for IBS crossovers to derive the trading conditions.

[wp_ad_camp_5]

 
Internal Bar strength is calculated using a simple formula,

IBS = (close-low)/(High-Low)

IBS takes values between 0 and 1 and simply indicates at which point along the day’s range the closing price is located.

Cumulative IBS

Buy and Sell Rules
Adapted timeframe : Daily
Holding Period : 1 day.

Go Long : If maIBS crosses below 0.3 and buy next day open
Long Exit : Exit the Same day at Close

Go Short : If maIBS crosses above 0.75 and buy next day open
Short Exit : Exit the Same day at Close

Amibroker AFL code
Download IBS AFL code

Backtest Results
For those who are interested here are the backtested results.
Bactesting Period : May 2007 – April 2014
Commisions – Rs200 per trade included for 2 lots of Nifty (includes both buy and sell transaction)

Backtest results

Equity Curve
Equity Curve

Underwater Equity
Underwater Equity

Profit Table
Profit Table

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 and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

Dynamic Color Coding in Amibroker Profit Tables: A Visually…

Profit tables are a valuable tool for traders and investors to analyze the trading strategy performance of their investments over time. However, the traditional...
Rajandran R
3 min read

Plotting Dynamic Intraday Straddle Charts using Amibroker

Recently Intraday Straddle sellers are on the rise and so the questions to us about how to plot intraday straddle spread dynamically during the...
Rajandran R
3 min read

Send Smart Options Execution Orders from Futures or Spot…

This tutorial provides instructions on how to utilize simple buy and sell trading signals in Spot/Future charts to place option orders (including ATM, ITM,...
Rajandran R
11 min read

3 Replies to “Internal Bar Strength – Mean Reversion Trading AFL code”

  1. Hi Rajandran ,

    Thanks for sharing this system.

    Could you please share a screenshot of BackTest Settings as well ?

    Thanks!

  2. Also, if it is not too much to ask, could you please point to a guiding document of BackTest settings.

    Thanks Again.

  3. Dear Rajendran,

    its my great pleasure to talking with genious guy like you ,, i have beeen searching some reversal Afl in intraday in commodity ..
    commodity move is highly volatile

    Could you suggest some AFL for intraday perspective ??

Leave a Reply

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