Draw rectangle in the future – SMC

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #203681 quote
    Khaled
    Participant
    Veteran

    Hello, based on the Smart Money Concept, I would like to draw the Premium/Equilibrium/Discount zones on a Weekly, Daily, H4 and H1 basis, all displayed on a H1 chart (200 units).

    With the indicator below, added Weekly, Daily, H4 and H1 on the same chart, I can see the weekly zones only when I display 50k units, which will slow the plateforme during trading hours.

    The weekly Premium zone is around 4800pts and the Weekly Equilibrium zone is around 3500pts, which are not drawn on the H1 chart (200 units – graph2).

    Is there a way to have all these zones on the H1 chart?

    Thanks

    //DEFPARAM CALCULATEONLASTBARS = 1000
    //defparam drawonlastbaronly=true
    
    TIMEFRAME(WEEKLY)
    HiWeekly = highest[200](high) + 20
    LoWeekly = lowest[200](low) - 20
    
    
    TIMEFRAME(Weekly)
    //---external parameters
    cp = 20
    
    once lastpoint = 0
    ATR = averagetruerange[cp]
    
    //---major zigzag points
    if high[cp] >= highest[2*cp+1](high) then
    LH = 1
    else
    LH = 0
    endif
    
    if low[cp] <= lowest[2*cp+1](low)  then
    LL = -1
    else
    LL = 0
    endif
    
    if LH = 1 then
    TOPy = high[cp]
    TOPx = barindex[cp]
    endif
    
    if LL = -1 then
    BOTy = low[cp]
    BOTx = barindex[cp]
    endif
    
    
    //---mino zigzag points
    if high[round(cp/2)] >= highest[cp+1](high) then
    LLH = 1
    else
    LLH = 0
    endif
    //
    if low[round(cp/2)] <= lowest[cp+1](low)  then
    LLL = -1
    else
    LLL = 0
    endif
    //
    if LLH = 1 then
    LTOPy = high[round(cp/2)]
    LTOPx = barindex[round(cp/2)]
    endif
    //
    if LLL = -1 then
    LBOTy = low[round(cp/2)]
    LBOTx = barindex[round(cp/2)]
    endif
    //
    
    
    
    /////////
    //if LH>0 and (lastpoint=-1 or lastpoint=0) then
    //DRAWTEXT("▼",TOPx,TOPy+ATR/2,Monospaced,Bold,20) coloured(200,0,0,255)
    //lastpoint = 1
    //endif
    //if LLH>0 then
    //DRAWTEXT("▽",LTOPx,LTOPy+ATR,Dialog,Bold,14) coloured(200,0,0,255)
    //endif
    //if LL<0 and (lastpoint=1 or lastpoint=0) then
    //DRAWTEXT("▲",BOTx,BOTy-ATR/2,Monospaced,Bold,20) coloured(0,200,0,255)
    //lastpoint = -1
    //endif
    //if LLL<0 then
    //DRAWTEXT("△",LBOTx,LBOTy-ATR,Dialog,Bold,14) coloured(0,200,0,255)
    //endif
    ///////////
    
    // Definition Premium Zone
    PremPointH = max(TOPy,LTOPy)
    PremPointL = PremPointH -tr/3
    PremiumTextPoint = (PremPointH+PremPointL)/2
    
    // Definition Discount Zone
    DiscountPointL = min(BOTy,LBOTy)
    DiscountPointH = DiscountPointL +tr/3
    DiscountTextPoint = (DiscountPointH+DiscountPointL)/2
    
    // Definition Equilibrium Zone
    EquiPoint = (PremPointH+DiscountPointL)/2
    EquiPointH = EquiPoint + tr/4
    EquiPointL = EquiPoint - tr/4
    EquiTextPoint = EquiPoint
    
    StartBox = min(TOPx-cp,BOTx-cp)
    TextBar = (barindex+20000 + StartBox)/2
    
    if IsLastBarUpdate then
    DRAWRECTANGLE(StartBox, PremPointL, barindex+200000, PremPointH)coloured(200,0,0,50)bordercolor(200,0,0,255)
    DRAWTEXT("Premium Weekly", TextBar, PremiumTextPoint)coloured(200,0,0,255)
    
    DRAWRECTANGLE(StartBox, DiscountPointH, barindex+200000, DiscountPointL)coloured(0,200,0,50)bordercolor(0,200,0,255)
    DRAWTEXT("Discount Weekly", TextBar, DiscountTextPoint)coloured(0,200,0,255)
    
    DRAWRECTANGLE(StartBox, EquiPointH, barindex+200000, EquiPointL)coloured(128,128,128,50)bordercolor(128,128,128,255)
    DRAWTEXT("Equilibrium Weekly", TextBar, EquiTextPoint)coloured(128,128,128,255)
    
    endif
    
    RETURN HiWeekly,LoWeekly
    #203684 quote
    fifi743
    Participant
    Master

    it is necessary to put many many units

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

Draw rectangle in the future – SMC


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Khaled @khaled Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by fifi743
3 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/06/2022
Status: Active
Attachments: 2 files
Logo Logo
Loading...