Range yesterday between 3:30 p.m. and 10 p.m

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #221156 quote
    phoentzs
    Participant
    Master

    How can I set a range that refers to the previous day, i.e. yesterday, between 3:30 p.m. and 10:00 p.m.? So when I trade today I want to refer to the highs and lows of yesterday between 3:30 p.m. and 10:00 p.m.

    #221199 quote
    robertogozzi
    Moderator
    Master

    There you go:

    ONCE HH  = high    //today's HIGH
    ONCE LL  = low     //today's LOW
    ONCE yHH = high    //yesterday's HIGH
    ONCE yLL = low     //yesterday's LOW
    IF OpenTime >= 153000 AND OpenTime <= 220000 THEN
       IF OpenTime = 153000 THEN
          yHH = HH
          yLL = LL
          HH  = high
          LL  = low
       ENDIF
       HH = max(HH,high)
       LL = min(LL,low)
    ENDIF
    #221214 quote
    MaoRai54
    Participant
    Master

    Roberto,

    sorry but I really cannot understand this snippet.

    Are you so kind to explain it ?

    Many thanks 🙂

    #221218 quote
    LucasBest
    Participant
    Average
    ONCE HH  = high    //today's HIGH
    ONCE LL  = low     //today's LOW
    
    IF OpenTime >= 153000 AND OpenTime <= 220000 THEN
       IF OpenTime = 153000 THEN
          HH  = high // at 15h30 hh store the high of the 1st candle
          LL  = low  // at 15h30 hh store the low of the 1st candle
       ENDIF
       // Every candle after 15h30 and before 22h00 update HH if High of the candle is higher than previous HH
       HH = max(HH,high)
       // Every candle after 15h30 and before 22h00 update LL if low of the candle is lower than previous LL
       LL = min(LL,low)   
    ENDIF

    Now as you want the range of previous day, you want to store the range of the day in previous day variables before any updates of HH and LL, so it is first thing to do at 15h30

    yHH = HH
    yLL = LL

    Now you can draw 2 segmnents using yHH and yLL

    robertogozzi thanked this post
    #221220 quote
    robertogozzi
    Moderator
    Master

    @MaoRai54

    what LucasBest wrote is correct, is that all you need to know?

    #221234 quote
    phoentzs
    Participant
    Master

    Thank you, Roberto. And now we’re building a range breakout system with SL at the opposite end and a TP of 1.5*Range… would something like that be profitable?

    #221241 quote
    LucasBest
    Participant
    Average

    I’ve read here below that : “If a trending stock makes a new high after 11:15-11:30am EST, there is a 75% chance of closing within 1% of High of day (HOD). Same applies for downtrend.”

    https://fr.tradingview.com/script/j5fydEzi-Drip-s-11am-rule-breakout-breakdown-OG/

    #221253 quote
    JC_Bywan
    Moderator
    Master

    The If statement:

    IF OpenTime >= 153000 AND OpenTime <= 220000 THEN

    is ok if you want to include the candle starting at 22h in your range. In case you don’t (last candle before 22h as last candle of range), then the if statement becomes:

    IF OpenTime >= 153000 AND OpenTime < 220000 THEN
    #221261 quote
    phoentzs
    Participant
    Master

    Can you please code me a simple breakout system from this?

    #221263 quote
    phoentzs
    Participant
    Master

    I tried with following logic in Nasdaq TF M15. But it doesn’t look really good.

    Long   = HH crosses over yHH  
    Longex = close crosses under LL and Exit=1
    Short   = LL crosses under yLL
    Shortex = close crosses over HH and Exit=1
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Range yesterday between 3:30 p.m. and 10 p.m


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
phoentzs @phoentzs Participant
Summary

This topic contains 9 replies,
has 5 voices, and was last updated by phoentzs
2 years, 5 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/17/2023
Status: Active
Attachments: No files
Logo Logo
Loading...