Nigel Hawks volume indicator

Forums ProRealTime English forum ProBuilder support Nigel Hawks volume indicator

  • This topic has 10 replies, 2 voices, and was last updated 9 months ago by avatarSVK.
Viewing 11 posts - 1 through 11 (of 11 total)
  • #218276
    SVK

    Hi all,

    would it be possible to translate PineScript indicator to Prorealcode please ?

    Thank you very much

    HawkEye volume, developed by Nigel Hawks, is supposed to be a premier VSA indicator.

    // @author LazyBear
    // If you use this code, in its original or modified form, do drop me a note. Thx.
    //
    study(“HawkEye Volume Indicator [LazyBear]”, shorttitle=”HVI_LB”)
    length=input(200)
    range=high-low
    rangeAvg=sma(range,length)
    volumeA=sma(volume, length)
    divisor=input(3.6)
    high1=high[1]
    low1=low[1]
    mid1=hl2[1]
    u1 = mid1 + (high1-low1)/divisor
    d1 = mid1 – (high1-low1)/divisor
    r_enabled1 = (range > rangeAvg) and (close < d1) and volume > volumeA
    r_enabled2 = close < mid1
    r_enabled = r_enabled1 or r_enabled2
    g_enabled1 = close > mid1
    g_enabled2 = (range > rangeAvg) and (close > u1) and (volume > volumeA)
    g_enabled3 = (high > high1) and (range < rangeAvg/1.5) and (volume < volumeA)
    g_enabled4 = (low < low1) and (range < rangeAvg/1.5) and (volume > volumeA)
    g_enabled = g_enabled1 or g_enabled2 or g_enabled3 or g_enabled4
    gr_enabled1 = (range > rangeAvg) and (close > d1) and (close < u1) and (volume > volumeA) and (volume < volumeA*1.5) and (volume > volume[1])
    gr_enabled2 = (range < rangeAvg/1.5) and (volume < volumeA/1.5)
    gr_enabled3 = (close > d1) and (close < u1)
    gr_enabled = gr_enabled1 or gr_enabled2 or gr_enabled3
    v_color=gr_enabled ? gray : g_enabled ? green : r_enabled ? red : blue
    plot(volume, style=histogram, color=v_color, linewidth=5)

     

    #218278
    JS

    Hi @SVK

    Hereby the translation of the HawkEye Volume Indicator…

     

    2 users thanked author for this post.
    #218311
    SVK

    JS,

    thank you very much for your help.

    Works perfect 🙂

    Would you know how can I incorporate signals from this indicator into strategy ?
    Signals would be only Green & Red bars.

    Divisor setting I’m using is 1.5 which reduces amount of green & red bars significantly.

    Thank you very much for your help

    PS.

    If you have Paypal I’m more than happy to send you some beer money 🙂

     

    #218312
    JS

    Hi SVK,

    As you’ve probably noticed, Renabled stands for “Red (enabled)”, Genabled for “Green (enabled)” and GREnabled for “Grey (enabled)”…

    If you want to use the green and red signals in a system, you will end up with the following:

    If GEnabled then

    Buy 1 contract at Market

    EndIf

    If REnabled then

    SellShort 1 contract at Market

    EndIf

    Thanks for the offer but is not necessary… 🙂

     

    1 user thanked author for this post.
    avatar SVK
    #218313
    SVK

    Thank you 🙂
    I’m going to try it out and see how it works 🙂

    #218314
    JS

    Hi SVK,

    Good luck…
    Please note; the example is just a “basic” system, both Long and Short, 1 type of order, no MoneyManagement, no StopLoss, no TakeProfit or Trailing…etc.
    Plenty to do… 🙂

    1 user thanked author for this post.
    avatar SVK
    #218315
    SVK

    I have done following and it doesn’t work 🙁

    On a graph you can see that Grey bars are highlighted as green.

    #218319
    SVK

    Tried code on it’s own and I’m getting the same result.

    I have added green vertical lines to highlight where Red graph should allign with.

     

    #218321
    JS

    Hi SVK,

    Strange, I think it’s because there’s an overlap between the different conditions…

    When you try like this you get the right result…

    1 user thanked author for this post.
    #218323
    SVK

    Hi LS,

    Let me try 🙂

    #218337
    SVK

    JS,

    looks good to me 🙂

    Thank you very much

    1 user thanked author for this post.
    avatar JS
Viewing 11 posts - 1 through 11 (of 11 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login