Bank Level indicator

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #56825 quote
    BiggestNoob
    Participant
    New

    Hi All,

    I came across Paul Langham’s channel on You tube and in it he mentioned an indicator than draws in lines which he says the banks ‘trade’ at (I.e they often make a move at).

    Basically it seems to consist of the highs and lows for the last :-

    10 weeks

    10 Months

    10 Quarters

    10 Years

     

    I am not a coder which can be seen from my daily level effort which I have attached.

    x = i
    for i = 1 to 10 do
    next
    
    a = DHigh(x)
    b = DLow(x)
    
    DRAWHLINE(a)
    DRAWHLINE(b)
    
    return
    

    It doesnt seem to work as intended :o(

    Can someone give me some direction? I tried to substitue Dhigh for Month[high] and it said it expected a positive value?

    Regards

    BN

    #57166 quote
    Nicolas
    Keymaster
    Master

    I just made this rough code for this purpose, it only calculates the last 10 weeks and 10 months highest high and lowest low, not tested but should be ok.

    I’ll try to add the other levels later, time to rest a bit now 🙂

    Once lastWeekBarIndex = 0
    Once weeklyHigh = undefined
    Once weeklyLow = undefined
    
    Once lastMonthBarIndex = 0
    Once monthlyHigh = undefined
    Once monthlyLow = undefined
    
    If DayOfWeek<DayOfWeek[1] then
    countw=countw+1
    weeklyHigh = Highest[BarIndex - lastWeekBarIndex](High)[1]
    weeklyLow = Lowest[BarIndex - lastWeekBarIndex](Low)[1]
    lastWeekBarIndex = BarIndex
    
    hhw=max(hhw,weeklyhigh)
    llw=min(llw,weeklylow)
    
    if countw=10 then 
    weeks10hi = hhw
    weeks10lo = llw
    hhw = 0
    llw = close*1000
    countw = 0
    endif
    Endif
    
    If Month<>Month[1] then
    countm=countm+1
    monthlyHigh = Highest[BarIndex - lastMonthBarIndex](High)[1]
    monthlyLow = Lowest[BarIndex - lastMonthBarIndex](Low)[1]
    lastMonthBarIndex = BarIndex
    
    hhm=max(hhm,monthlyhigh)
    llm=min(llm,monthlylow)
    
    if countm=10 then
    months10hi = hhm
    months10lo = llm
    hhm = 0
    llm = close*1000
    countm=0
    endif
    Endif
    
    
    Return weeks10hi as "10 weeks high", weeks10lo as "10 weeks low", months10hi as "10 months high", months10lo as "10 months low"
    10-weeks-and-10-months-high-low.png 10-weeks-and-10-months-high-low.png
    #57259 quote
    BiggestNoob
    Participant
    New

    Cheers Nicolas,

    I will have a play around with it when I get in tonight

    #79429 quote
    hairless414
    Participant
    New

    how do i use the code? copy paste in mt4 ? also how to code for yearly and quaterly

    #79489 quote
    Vonasi
    Moderator
    Master

    how do i use the code? copy paste in mt4 ? also how to code for yearly and quaterly

    The code is for use with ProRealTime only. This is a forum dedicated to ProRealTime code – it is not a place to find MQ4 code solutions.

    #113428 quote
    jandehaas
    Participant
    Junior

    Hello Nicolas,

    I am also interested in this indicator,I tried to install it but it does not seem to work,could you test it ?

    Thank you,

    Jan

    #113431 quote
    Vonasi
    Moderator
    Master

    Did you add it to the price chart via the wrench in the top left corner?

    #113444 quote
    jandehaas
    Participant
    Junior

    I tried that too but it gives me the same error notice,I attached a screen shot …

    Banklevels-screen-shot-copy.jpg Banklevels-screen-shot-copy.jpg
    #113449 quote
    Vonasi
    Moderator
    Master

    Sorry but that screen shot is not clear enough to read. I just cut and pasted Nicolas’ code into a new indicator and it works fine. What instrument and time frame are you applying it to so that everyone else can try to get the same error?

    #113457 quote
    robertogozzi
    Moderator
    Master

    It seems there’s a wrong value within brackets with HIGHEST and LOWEST.

    Try using

    [max(1,BarIndex - lastWeekBarIndex)]

    at lines 11-12, and

    [max(1,BarIndex - lastMonthBarIndex)]

    at lines 29-30.

    #113463 quote
    Vonasi
    Moderator
    Master

    Perhaps it is trying to get the values on the first bar of a chart (barindex = 0) so that would create a negative value in the HIGHEST and LOWEST brackets. So you could just enclose the main code within the following IF THEN ENDIF to avoid this:

    Once lastWeekBarIndex = 0
    Once weeklyHigh = undefined
    Once weeklyLow = undefined
    
    Once lastMonthBarIndex = 0
    Once monthlyHigh = undefined
    Once monthlyLow = undefined
    
    if barindex > 0 then
    
    If DayOfWeek<DayOfWeek[1] then
    countw=countw+1
    weeklyHigh = Highest[BarIndex - lastWeekBarIndex](High)[1]
    weeklyLow = Lowest[BarIndex - lastWeekBarIndex](Low)[1]
    lastWeekBarIndex = BarIndex
    
    hhw=max(hhw,weeklyhigh)
    llw=min(llw,weeklylow)
    
    if countw=10 then 
    weeks10hi = hhw
    weeks10lo = llw
    hhw = 0
    llw = close*1000
    countw = 0
    endif
    Endif
    
    If Month<>Month[1] then
    countm=countm+1
    monthlyHigh = Highest[BarIndex - lastMonthBarIndex](High)[1]
    monthlyLow = Lowest[BarIndex - lastMonthBarIndex](Low)[1]
    lastMonthBarIndex = BarIndex
    
    hhm=max(hhm,monthlyhigh)
    llm=min(llm,monthlylow)
    
    if countm=10 then
    months10hi = hhm
    months10lo = llm
    hhm = 0
    llm = close*1000
    countm=0
    endif
    Endif
    
    endif
    
    Return weeks10hi as "10 weeks high", weeks10lo as "10 weeks low", months10hi as "10 months high", months10lo as "10 months low"
    
    
    #134412 quote
    tobytarczy
    Participant
    New

    Hi

    I think there is a lot more to these levels than meets the eye. From my understanding these levels include a number of variables that help to define the level itself, such as, how recent has the level been hit, if the market goes through the level, which would be a negative score, volume or number of transactions at the level, etc. this is based on an indicator I have used on MT4 where this was the case.  I think what Paul Langham has developed is similar to the tool, maybe more advanced.

    I would love to have such an indicator as it is really helpful in setting up a trade in determining stops and targets. If someone knows how to get this in PRT that would be great.

    Toby

    #134432 quote
    Nicolas
    Keymaster
    Master

    Please define the ways to calculate those levels and maybe someone would code it? Math formulas are appreciated, thanks.

    #134435 quote
    tobytarczy
    Participant
    New

    Hi, Let me see if I can get the details you need from my source.  Many thanks

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.

Bank Level indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 13 replies,
has 7 voices, and was last updated by tobytarczy
5 years, 8 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 12/29/2017
Status: Active
Attachments: 2 files
Logo Logo
Loading...