outsidebar trading code

Forums ProRealTime English forum ProBuilder support outsidebar trading code

Viewing 15 posts - 1 through 15 (of 18 total)
  • #248598
    Can someone help me, i get an error with outsidebar code: the following variable is not defined: Signalbarheight
    //SignalbarHeight=5
    if range>=SignalbarHeight*pipsize then
    if high>high[1] and close<low[1] then
      bear=1
      bull=0
    elsif low<low[1] and close>high[1] then
      bull=1
      bear=0
    else
      bear=0
      bull=0
    endif
    else
    bear=0
    bull=0
    endif
    offset=AverageTrueRange[14](close)*2
    if bear then
    DRAWARROWDOWN(barindex, high+offset) coloured(255,0,0)
    elsif bull then
    DRAWARROWUP(barindex, lowoffset) coloured(0,255,0)
    endif
    return
    #248599

    Uncomment line 1 (remove the two leading slashes).

     

    1 user thanked author for this post.
    #248600

    Hi,

    try deleting the // at beginning of the first line: //SignalbarHeight=5

    SignalbarHeight=5

    if range>=SignalbarHeight*pipsize then
    if high>high[1] and close<low[1] then
      bear=1
      bull=0
    elsif low<low[1] and close>high[1] then
      bull=1
      bear=0
    else
      bear=0
      bull=0
    endif
    else
    bear=0
    bull=0
    endif
    offset=AverageTrueRange[14](close)*2
    if bear then
    DRAWARROWDOWN(barindex, high+offset) coloured(255,0,0)
    elsif bull then
    DRAWARROWUP(barindex, lowoffset) coloured(0,255,0)
    endif
    return
    2 users thanked author for this post.
    #248602

    (Roberto was faster)

    1 user thanked author for this post.
    #248737

    Can someone help me, i get the following message when i want to add an alert to the oudsidebar code: not possible because it contains an undefined value

    #248752

    What code are you using to define your outside bar?

    #248753

    This  is de code i use.

     

    SignalbarHeight=5

    if range>=SignalbarHeight*pipsize then
    if high>high[1] and close<low[1] then
    bear=1
    bull=0
    elsif low<low[1] and close>high[1] then
    bull=1
    bear=0
    else
    bear=0
    bull=0
    endif
    else
    bear=0
    bull=0
    endif
    offset=AverageTrueRange[14](close)*2
    if bear then
    DRAWARROWDOWN(barindex, high+offset) coloured(255,0,0)
    elsif bull then
    DRAWARROWUP(barindex, low-offset) coloured(0,255,0)
    endif

    #248754

    Have you got the word ‘Return’ at the end of your code that you are using (it needs to be for the code to work)?

    I say above because ‘Return’ is not visible at the end of the code you posted above.

    #248756

    Yes the code contains return at the end see the first post

    #248757

    So using the attached Settings for Alerts … which conditions are you using to try and set an Alert for the Outside bar?

    As you cannot set an Alert for when an ‘Arrow’ is visible –  the only other option surely – is you would need to set conditions for all the Conditions that make up the Indicator (and thus be independent of the Indicator code producing Arrows??) ?

    Maybe I need more coffee?? 🙂

    #248759

    Idea – rejig the code so it gives a ‘1’ for red / down arrow and ‘2’ for green / up arrow and then add the Indicator in it’s own / separate chart (below price) then set an Alert on the values ‘1’ and ‘2’ ?

    #248765

    The last code you posted (after appending RETURN), works like a charm on different timeframes and different units:

    In any case I suggest using this simplified version:

     

    1 user thanked author for this post.
    #248768

    Here you go.

    Add the code below as a ‘New Panel’ and then set Alert on value = 1 (bull) or value = -1 (bear)

     

    2 users thanked author for this post.
    #248771

    Thanks for figuring it out, unfortunattley i’m not knowledgeable enough to implement this in the code

    #248772

    Sorry i’m only now seeing the code, thanks for looking it up

Viewing 15 posts - 1 through 15 (of 18 total)

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