Changement TIMEFRAME IMBALANCE

Forums ProRealTime forum Français Support ProBuilder Changement TIMEFRAME IMBALANCE

Viewing 8 posts - 1 through 8 (of 8 total)
  • #241985

    Bonjour,

    ci-joint le code imbalance trouvé sur le forum. Je souhaiterais mettre ce code en 30 mn sur un graphique 5MN.

    TIME FRAME(30minutes)   apparemment ne fonctionne pas.

    DEFPARAM DrawOnLastBarOnly = true
    DEBUG = 0

    // Start of code, don’t change anything below

    IF IsLastBarUpdate THEN
    $RangeHigh[0] = 0
    $RangeLow[0] = 0
    $RangeIndex[0] = 0
    RangeIdx = 0
    BI = 0
    B = 0
    RI = 0
    TotalBars = BarIndex[0]

    IF DEBUG = 1 THEN
    DRAWTEXT(“Total bars: #TotalBars#”, BarIndex[0], High[0])
    ENDIF

    // List all imbalance
    FOR RI = 1 TO TotalBars – 2 DO
    BI = BarIndex[RI]
    //drawtext(“#BI#”, BI, High[RI])
    IF High[BI – 1] < Low[BI + 1] THEN
    RangeIdx = RangeIdx + 1
    $RangeHigh[RangeIdx] = Low[BI + 1]
    $RangeLow[RangeIdx] = High[BI – 1]
    $RangeIndex[RangeIdx] = RI
    ENDIF
    IF High[BI + 1] < Low[BI – 1] THEN
    RangeIdx = RangeIdx + 1
    $RangeHigh[RangeIdx] = Low[BI – 1]
    $RangeLow[RangeIdx] = High[BI + 1]
    $RangeIndex[RangeIdx] = RI
    ENDIF
    NEXT

    IF DEBUG = 1 THEN
    DRAWTEXT(“Imbalance found: #RangeIdx#”, BarIndex[0], Low[0])
    ENDIF

    // Remove mitigated imbalance
    FOR RI = 1 TO RangeIdx DO
    IF DEBUG = 1 THEN
    DRAWRECTANGLE($RangeIndex[RI] – 1, $RangeHigh[RI], $RangeIndex[RI] + 1, $RangeLow[RI]) COLOURED(“yellow”,150)
    ENDIF

    Valid = 1
    FOR B = $RangeIndex[RI] + 2 TO TotalBars DO
    LB = Low[BarIndex[B]]
    HB = High[BarIndex[B]]
    // Candle is above or below our zone, ignore it
    IF LB >= $RangeHigh[RI] OR HB <= $RangeLow[RI] THEN
    IF DEBUG = 1 THEN
    DRAWTEXT(“Out”, B, High[BarIndex[B]])
    ENDIF
    CONTINUE
    ENDIF

    IF LB <= $RangeLow[RI] THEN
    // Candle engulfs our zone, so imbalance is mitigated
    IF HB >= $RangeHigh[RI] THEN
    IF DEBUG = 1 THEN
    DRAWTEXT(“Mitigated”, B, High[BarIndex[B]])
    ENDIF
    Valid = 0
    BREAK
    ENDIF
    IF DEBUG = 1 THEN
    DRAWTEXT(“High”, B, High[BarIndex[B]])
    ENDIF
    $RangeLow[RI] = HB
    ELSE
    // In this case, Low is within the zone
    IF DEBUG = 1 THEN
    DRAWTEXT(“Low”, B, High[BarIndex[B]])
    ENDIF
    $RangeHigh[RI] = LB
    ENDIF
    NEXT
    IF Valid = 1 THEN
    DRAWRECTANGLE($RangeIndex[RI], $RangeHigh[RI], TotalBars+2000, $RangeLow[RI]) COLOURED(0,0,0,0) FILLCOLOR(“yellow”,150)
    ENDIF

    NEXT

    ENDIF

    RETURN

     

     

    merci

    #241991

    J’ai utilisé Copier & Coller et cela fonctionne sur une période de 1 minute, 5 minutes, 30 minutes, 1 heure et quotidienne.

     

    #241992

    oui merci je sais que le code fonctionne bien dans tous les timeframes.

    Mais ma question est

    comment mettre graphiquement le code imbalance 30 minutes dans un graphique 5 MN 

    #242048

    Essaye ceci :

     

     

    #242067

    J’ai un message d’erreur

    entier positif

    #242228

    Cela devrait résoudre l’erreur :

     

    #242233

    pas mieux

    #242339

    Je pense que c’est un manque d’unités. Essayez d’utiliser plus d’unités sur votre graphique, disons 100+.

     

Viewing 8 posts - 1 through 8 (of 8 total)

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