Inside Bar

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #143992 quote
    gfx
    Participant
    Average

    Hi all,

    I am looking for an easy way to identify on the price chart the inside bar configuration.

    In other words, when the latest bar is inside the previous, I would like a short line to be drawn 1 tick above and another on tick below both bars.

    Has someone already coded such an indicator ?

    Thks for helping.

    B.

    gfx

    #143998 quote
    JC_Bywan
    Moderator
    New

    Topic moved from french forum to english forum, please make sure before posting a message it is in sync with the forum rules in the big yellow box below (in this particular case, the 3rd one: using same language as chosen forum), thank you.

    #144014 quote
    robertogozzi
    Moderator
    New

    Not tested:

    InsideBAR = range < range[1] AND low >= low[1] AND high <= high[1]
    IF InsideBAR THEN
       DrawSegment(Barindex[1],high,BarIndex,high)
       DrawSegment(Barindex[1],low ,BarIndex,low)
    ENDIF
    RETURN
    #144349 quote
    gfx
    Participant
    Average

    Thks. I ended up with the following. Hope it helps any other IB trader.

     

    // ==========================================
    // 'Inside Bar' Display on screen 
    // Version 1.0 - 20200913 - IB
    // gfx2trade
    // ==========================================
    
    // ==================================================================================
    // Further ideas to code 
    // ==================================================================================
    
    // n/a
    
    // ==================================================================================
    // Definition && Affectation
    // ==================================================================================
    
    IBG = averagetruerange[14](close)*0.2
    
    IBU = open[1]<close[1] and high[0]<high[1] and low[0]>low[1] 
    IBD = open[1]>close[1] and high[0]<high[1] and low[0]>low[1]
    
    // ==================================================================================
    // Calculs
    // ==================================================================================
    
    // ----------------------------------------------------------------------------------
    // Inside Bar 
    // ----------------------------------------------------------------------------------
    
    if IBU then
        DRAWSEGMENT(barindex-1,high[1]+IBG,barindex,high[1]+IBG) coloured(255,153,0)
        DRAWSEGMENT(barindex-1,low[1]-IBG,barindex,low[1]-IBG) coloured(255,255,0)
    endif
    
    if IBD then
        DRAWSEGMENT(barindex-1,high[1]+IBG,barindex,high[1]+IBG) coloured(255,153,0)
        DRAWSEGMENT(barindex-1,low[1]-IBG,barindex,low[1]-IBG) coloured(255,255,0)
    endif
    
    RETURN
    
    

     

    #220881 quote
    bernardmorel
    Participant
    New

    Good evening Thank you for your response and your collaboration I copied the codes and included them in the indicators But they did not work and no results on the graph I must have done something wrong but I have already done it this way and it worked J For the moment I have the out side candle indicator and it helps me a lot. Kind regards

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

Inside Bar


ProBuilder support

New Reply
Author
author-avatar
gfx @gfx Participant
Summary

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

Topic Details
Forum: ProBuilder support
Language: English
Started: 09/12/2020
Status: Active
Attachments: No files
Logo Logo
Loading...