weekly high low indicator

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #221482 quote
    flippingthefib
    Participant
    Veteran

    Hi can anyone code me a high low weekly and daily indicator or help me to do it

    With Thanks

    #221495 quote
    JS
    Participant
    Senior

    Hi @flippingthefib

    You can use the standard indicator “Donchian Channel”…

    Donchian Channel works with:

    WeekHigh=Highest[Period](High)

    WeekLow=Lowest[Period](Low)

    For example, if you use a time frame of 1 hour, you use for the period of a week:

    Period=24 x 5 = 120 (24 hours x 5 days)

    #221514 quote
    flippingthefib
    Participant
    Veteran
    Thanks Js but is there a code i can put in for last weeks high low that goes into this week that i can use on the 15 min chart im just looking dor them 2 lines   With thanks
    #221519 quote
    JS
    Participant
    Senior
    Hi, Try this…
    TimeFrame(1 week, UpdateOnClose)
    
    PWeekHigh = Highest[1](High[1])
    PWeekLow = Lowest[1](Low[1])
    
    TimeFrame(default)
    
    Return PWeekHigh, PWeekLow
    #221522 quote
    JS
    Participant
    Senior
    Hi, Sorry, you’d better use the following…
    TimeFrame(1 week, UpdateOnClose)
    
    PWeekHigh = Highest[1](High)
    PWeekLow = Lowest[1](Low)
    
    TimeFrame(default)
    
    Return PWeekHigh[1], PWeekLow[1]
    #221525 quote
    phoentzs
    Participant
    Master
    That should work too.
    lastweekhigh = high 
    lastweeklow = low
    #221555 quote
    flippingthefib
    Participant
    Veteran
    Thank You JS and Phontzs Thats what i wanted I wantes to back test my strat that if i sold at the high and buy at the low. But for some reason i cant figure out it keeps giving an error as attached any ideas With thanks
    #221568 quote
    robertogozzi
    Moderator
    Master
    Maybe some odd characters have been added unintentionally while editing or pasting code.
    #221586 quote
    flippingthefib
    Participant
    Veteran
    More help please The code below i wanted to set the time for the 8 hours to be 22.00 06.00 and 1400 as the time But the come in on the chart as  00.00 08.00 and 16.00 Can and how do i do this please With thanks to anyone who can help me
    #221589 quote
    phoentzs
    Participant
    Master
    But 8 hours is not a week… You have to choose the TF Week.
    TimeFrame(1 week, UpdateOnClose)
    #221594 quote
    flippingthefib
    Participant
    Veteran
    Yes but i need a weekly high low which i have But i also need an 8 hour high low with the high low of the 22.00 06.00 and 14.00 timeframe But it gives me the high low of the  00.00 08.00 16.00 timeframe  can i change it and how With thanks to all who are helping
    #221619 quote
    robertogozzi
    Moderator
    Master
    You can’t change the date the candles are formed, it’s a choice of the broker. You can only tag them using a different time zone.
    #221627 quote
    JS
    Participant
    Senior

    Or do you mean something like that, a “High” and a “Low” starting at a certain time (in this case 220000 hours) …

     
    TimeFrame(1 hour, UpDateOnClose)
    
    If OpenTime=220000 then
    xHigh2200=Highest[8](High)
    xLow2200=Lowest[8](Low)
    EndIf
    
    TimeFrame(Default)
    
    Return xHigh2200 as "High2200", xLow2200 as "Low2200"
    #221689 quote
    flippingthefib
    Participant
    Veteran
    Thank you JS That is perfect Im trying to backtest but it keeps giving me an error as attacked for some reason Im buying at the low and selling at the high Im doing this in simpilifed creation. As know little about coding Any idea how to do this With thanks
    #221691 quote
    JS
    Participant
    Senior

    Can you show the code…?

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

weekly high low indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 19 replies,
has 4 voices, and was last updated by flippingthefib
2 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 09/23/2023
Status: Active
Attachments: 11 files
Logo Logo
Loading...