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)

N Bar High-Low Dots – Amibroker AFL code

28 sec read

Here is a simple strategy that alerts by plotting dots over the candle whenever a new N bar high-low is made. The below chart shows Nifty future EOD charts and the Yellow dots in this example represents new 20 day high’s are made and the orange dots represents new 20 day lows are made. It provides a better visualization in your charts to identify the new high-low and the ongoing sentiment in the market.

High Low Dots

[wp_ad_camp_5]

 
The AFL provided below provides external control to set you own N-Bar High and N Bar Low Parameters. To change the Parameters apply the indicator to a new black chart -> Right click over the chart -> Goto Properties and set the required values.

https://gist.github.com/0ac0f3c32d58caf2a6a5

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)

ADXVMA – Indicator – Amibroker AFL Code

ADXVMA is a volatility moving average using ADX as a core concept to identify trends. The trend filter acts as support during uptrending markets...
Rajandran R
1 min read

[Free Webinar] Building a Trading System with Amibroker AFL…

Join us for an insightful webinar on mastering the art of creating a robust trading system using Amibroker's AFL coding. Whether you're a seasoned...
Rajandran R
1 min read

How to Perform Machine Learning Using Amibroker and Python

Amibroker is a powerful technical analysis and trading system development platform, used extensively by traders and analysts for developing and deploying trading strategies. Python,...
Rajandran R
5 min read

14 Replies to “N Bar High-Low Dots – Amibroker AFL code”

  1. Hi Rajandran sir,

    How to scan stocks which are below -20 of Williams %R .
    Could you pls give the AFL code

  2. the following code be appended for scan/explore in the afl at the end

    best rgds

    ————————————————————————————-

    Filter=hidot OR lowdot ;
    AddColumn(IIf(Hidot,Hidot,Null) ,” New High ” ,6.2,1.2,colorGreen);
    AddColumn(IIf(Lowdot,Lowdot,Null),” New Low “,6.2,1.2,colorOrange);

    _SECTION_END();

      1. Sorry, I can’t find any AFL code displayed, I am using Firefox and I tried with Chrome and IE. No AFL Code. Please check.

  3. hi,
    I am very much impressed by the code that you have been doing. Thank you for the big contribution that you are making to the trading community.

    Can you please help out in coding below idea.

    if the price is moved above the 0.8% of opening price of the first 2 min candle stick then buy and target being 1.6 % of the opening price of the first candle stick

    ex : opening price of 1st candle stick is 100 at 9:16 and at 9:18 or whenever the price reaches 100.8 i will buy and selling it when the price reaches to 101.6

    how can it be coded?

    Thank you in advance

    Shashi

    1. Hello Sir,

      Pls help me to set indicator stating open & high same and open & low same on the charts.in daily charts

  4. Hello Sir,

    Plotting of Indicator showing open & high same and open & low same on the chart.

    Pls do help & reply.

  5. Dear sir,

    Can any one make it a loop in afl

    Ydh1= TimeFrameGetPrice( “o”, inDaily,-1);
    Ydh2= TimeFrameGetPrice( “o”, inDaily,-2);
    Ydh3= TimeFrameGetPrice( “o”, inDaily,-3);
    Ydh4= TimeFrameGetPrice( “o”, inDaily,-4);
    Ydh5= TimeFrameGetPrice( “o”, inDaily,-5);
    Ydh6= TimeFrameGetPrice( “o”, inDaily,-6);
    Ydh7= TimeFrameGetPrice( “o”, inDaily,-7);
    Ydh8= TimeFrameGetPrice( “o”, inDaily,-8);
    Ydh9= TimeFrameGetPrice( “o”, inDaily,-9);
    Ydh10= TimeFrameGetPrice( “o”, inDaily,-10);
    Ydh11= TimeFrameGetPrice( “o”, inDaily,-11);
    Ydh12= TimeFrameGetPrice( “o”, inDaily,-12);
    Ydh13= TimeFrameGetPrice( “o”, inDaily,-13);
    Ydh14= TimeFrameGetPrice( “o”, inDaily,-14);
    Ydh15= TimeFrameGetPrice( “o”, inDaily,-15);
    Ydh16= TimeFrameGetPrice( “o”, inDaily,-16);
    Ydh17= TimeFrameGetPrice( “o”, inDaily,-17);
    Ydh18= TimeFrameGetPrice( “o”, inDaily,-18);
    Ydh19= TimeFrameGetPrice( “o”, inDaily,-19);
    Ydh20= TimeFrameGetPrice( “o”, inDaily,-20);
    Ydh21= TimeFrameGetPrice( “o”, inDaily,-21);

    yddH2 = Max(YdH1, YdH2);
    yddH3 = Max(yddH2,YdH3);
    yddH4= Max(yddH3,YdH4);
    yddH5= Max(yddH4,YdH5);
    yddH6= Max(yddH5,YdH6);
    yddH7= Max(yddH6,YdH7);
    yddH8= Max(yddH7,YdH8);
    yddH9= Max(yddH8,YdH9);
    yddH10= Max(yddH9,YdH10);
    yddH11= Max(yddH10,YdH11);
    yddH12= Max(yddH11,YdH12);
    yddH13= Max(yddH12,YdH13);
    yddH14= Max(yddH13,YdH14);
    yddH15= Max(yddH14,YdH15);
    yddH16= Max(yddH15,YdH16);
    yddH17= Max(yddH16,YdH17);
    yddH18= Max(yddH17,YdH18);
    yddH19= Max(yddH18,YdH19);
    yddH20= Max(yddH19,YdH20);
    yddH21= Max(yddH20,YdH21);

    yddm2 = Min(YdH1, YdH2);
    yddm3 = Min(yddm2,YdH3);
    yddm4= Min(yddm3,YdH4);
    yddm5= Min(yddm4,YdH5);
    yddm6= Min(yddm5,YdH6);
    yddm7= Min(yddm6,YdH7);
    yddm8= Min(yddm7,YdH8);
    yddm9= Min(yddm8,YdH9);
    yddm10= Min(yddm9,YdH10);
    yddm11= Min(yddm10,YdH11);
    yddm12= Min(yddm11,YdH12);
    yddm13= Min(yddm12,YdH13);
    yddm14= Min(yddm13,YdH14);
    yddm15= Min(yddm14,YdH15);
    yddm16= Min(yddm15,YdH16);
    yddm17= Min(yddm16,YdH17);
    yddm18= Min(yddm17,YdH18);
    yddm19= Min(yddm18,YdH19);
    yddm20= Min(yddm19,YdH20);
    yddm21= Min(yddm20,YdH21);

    21DHO= yddH21;
    21DLO = yddm21;

    10DHO = yddH10;
    10DLO = yddm10;

    5DHO= yddH5;
    5DLO = yddm5;

    3DHO= yddH3;
    3DLO = yddm3;

Leave a Reply

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