Thursday, August 25, 2016

Amibroker AFL For Previous Day High Low Close Levels

Previous day High Low and Close Levels are very important reference points for intraday traders. Many traders call them as Yesterday levels, Last day levels also. In Amibroker charts, most intraday traders use these levels by marking them manually through a horizontal line. Amibroker AFL for previous day high low close levels will automatically plot these levels on current day's intraday chart. This Amibroker AFL for previous day high low close levels will plot the levels only on current day's chart so there will be no clutter.

Simply three lines of previous day high , previous day low and previous day close will be plotted. The colour red line is previous day high, the clour green is previous day low and the colour light grey is previous day close.

You may also like: Top 10 Amibroker AFL

amibroker afl for previous day high low close levels
Previous Day High Low Close Levels Chart

Download Amibroker AFL For Previous Day High Low Close Levels

15 comments:

  1. how to extend this horizontal line both side? and display value?

    ReplyDelete
    Replies
    1. I am giving a code below which is different from the above code.

      Apply the below given code through the Formula Editor & you will get text written Previous day OHLC & also the values.

      Code:-

      Plot(TimeFrameGetPrice( "H", inDaily, -1 ),"PDH",colorBlue,styleThick);
      PlotText("High",BarCount,LastValue(TimeFrameGetPrice( "H", inDaily, -1 ),True),colorBlue);
      Plot(TimeFrameGetPrice( "L", inDaily, -1 ),"PDL",colorRed,styleThick);
      PlotText("Low",BarCount,LastValue(TimeFrameGetPrice( "L", inDaily, -1 ),True),colorRed);
      Plot(TimeFrameGetPrice( "O", inDaily, -1 ),"PDO",colorLightGrey,styleLine);
      PlotText("Open",BarCount,LastValue(TimeFrameGetPrice( "O", inDaily, -1 ),True),colorLightGrey);
      Plot(TimeFrameGetPrice( "C", inDaily, -1 ),"PDC",colorDarkGrey,styleLine);
      PlotText("Close",BarCount,LastValue(TimeFrameGetPrice( "C", inDaily, -1 ),True),colorDarkGrey);

      Delete
  2. Dear Aryan,

    First of all thank you for the wonderul AFL's you keep posting.

    I am wondering if you do have an AFL code which could plot horizontal lines at the highest price and lowest price of the last 3 days.

    For ex :

    Nifty
    Day 1, High = 10000, Low = 9950
    Day 2, High = 10025, Low = 9975
    Day 3, High = 10030, Low = 10000

    On Day 4, the AFL could two horizontal lines, one at the highest price of the last 3 days, i.e. 10030 and the other at the lowest price of the last three days, i.e. 9950.

    Appreciate you help.

    Thanks
    NK

    ReplyDelete
    Replies
    1. Hi Nayan,

      Thanks for your comment.

      Okay, check back in 3-4 days, I will try to post such AFL.

      Happy Trading !!

      Aryan.

      Delete
  3. Hello Aryan,

    Tried coding this last night.
    I think it works, may I request you to validate please whenever you do find sometime.

    H2 = TimeFrameGetPrice("H", inDaily, -2); // yesterdays high
    L2 = TimeFrameGetPrice("L", inDaily, -2); // low

    H3 = TimeFrameGetPrice("H", inDaily, -3); // yesterdays high
    L3 = TimeFrameGetPrice("L", inDaily, -3); // low

    x = IIf( H1 > H2, H1, H2 );
    HA = IIf(x > H3, x, H3);

    y = IIf( L1 < L2, L1, L2 );
    HL = IIf(y < l3, y, l3);

    Sorry if this isnt the way to code this, but I ain't a coder, just trying my hands on something interesting.

    Thanks
    NK

    ReplyDelete
    Replies
    1. Hi Nayan,

      I have posted the AFL which plots the 3 Day Highest High & Lowest Low Values & lines on the Chart.

      Link Under:

      http://tradecatcher.blogspot.in/2017/07/3-day-highest-high-breakout-lowest-low.html

      Happy Trading !!

      Delete
  4. Hi Aryan,

    Please discard my previous comment. I was able to get the current day open price by modifying a very minor thing in your original code -

    _SECTION_BEGIN("PreDay HLC");
    function CDL( array )
    {
    doy = DayOfYear();
    Lastdoy = doy == LastValue( doy );
    Dayline = array * Lastdoy;

    return IIf( Dayline, Dayline, Null );
    }

    //TIME FRAME CALCULATION
    H1 = TimeFrameGetPrice( "H", inDaily, -1 ); // yesterdays high
    L1 = TimeFrameGetPrice( "L", inDaily, -1 ); // low
    C1 = TimeFrameGetPrice( "C", inDaily, -1 ); // close
    DayO = TimeFrameGetPrice("O", inDaily); // current day open

    //PLOTS
    Plot( cdl( H1 ), "", colorRed, styleLine + styleThick + styleNoRescale + styleNoLabel );
    Plot( cdl( L1 ), "", colorBrightGreen, styleLine + styleThick + styleNoLabel );
    Plot( cdl( C1 ), "", colorBlue, styleLine + styleNoRescale + styleNoLabel );
    Plot(cdl( DayO ), "", colorWhite, styleLine + styleNoRescale + styleNoLabel );
    _SECTION_END();


    Kindly look into the intraday volume breakout afl/exploration request that i have posted couple of days back.


    Thank you and Happy Trading !

    Jaspreet

    ReplyDelete
    Replies
    1. Hi Jaspreet,

      Good to know you included the Open price in the AFL as per your requirement. Regarding Volume Breakout AFL , be assured if it is done it will be surely published by me & I am trying to find time from my crunching schedule to have a look at the same.
      Happy Trading !!

      Aryan.

      Delete
  5. Thanks Aryan , for considering my request. Your effort in running this useful blog is highly appreciable !

    Happy trading to you too !

    Jaspreet

    ReplyDelete
    Replies
    1. Hi Jaspreet ,

      As a starting point check this code which I am giving below and see if you can do some modification as per your requirements.

      Filter = V > 10*Ref(V,-1) AND V>100000;
      AddColumn(V, “Volume“, 1);


      This code scans Volume of stocks to the previous day and brings out shares which have 10 times of volume of stocks traded on the current day to the previous day. No: of shares is more than 1,00,000 . You can try by changing the conditions.

      For Intraday Volume Breakout Exploration I will be looking for the solution.

      Happy Trading !!

      Delete
  6. Hi Aryan,

    Thank you so much for your help. You have given me something to play around in amibroker. Let me do some research now and see how it goes.

    Happy Trading !!

    Regards,
    Jaspreet

    ReplyDelete
  7. Hi Aryan ,

    Do you have any afl that can plot multiple time frame in a single sheet in amibroker ? I am looking for something like below -

    https://www.youtube.com/watch?v=Hp2BBCjaoRI

    Please let me know if you can help me on this.

    Happy trading and thanks in advance :)

    Regards,
    Jaspreet

    ReplyDelete
    Replies
    1. Hi Jaspreet,

      I know that this is very sought after AFL but it actually has been created by a closed group of Amibroker coding experts and it is most probably controlled through DLL. I hope someday it comes out in public domain then it can be surely shared. :-)

      For now its not possible for me to get this kind of AFL. I have an AFL which plots a super imposed candle of a bigger time frame on a shorter time frame. If you have not already seen it then here is the link to the page where I have posted it.

      http://tradecatcher.blogspot.in/2016/12/multiple-timeframe-candlestick-chart.html

      Happy Trading & Have a Nice Time.

      Aryan.

      Delete
  8. Thank you so much Aryan for the quick reply and pointing me to the multiple timeframe chart afl. I will go through this and see how can i fit this in my trading. Looks pretty simple :)

    Happy trading and keep rocking :)

    Regards,

    ReplyDelete
    Replies
    1. You are Welcome Jaspreet !!

      Happy Trading & Take Care

      Aryan.

      Delete

Required US Government Disclaimer & CTFC Rule 4.41

Futures trading contains substantial risk and is not suitable for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only consider risk capital that should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. CTFC RULE 4.41 – HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS SUCH AS LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN. All trades, patterns, charts, systems, etc., discussed in this website or advertisement are for illustrative purposes only and not construed as specific advisory recommendations. All ideas and materials presented herein are for information and educational purposes only. No system or trading methodology has ever been developed that can guarantee profits or prevent losses. The testimonials and examples used herein are exceptional results which do not apply to average people and are not intended to represent or guarantee that anyone will achieve the same or similar results. Trades placed on the reliance of Trend Methods systems are taken at your own risk for your own account. This is not an offer to buy or sell futures interests.