Bollinger Band Crosses

Forums ProRealTime English forum ProOrder support Bollinger Band Crosses

Viewing 15 posts - 1 through 15 (of 16 total)
  • #177173

    MyLongConditions = close CROSSES OVER BollingerDOWN[20]
    MyShortConditions = close CROSSES UNDER BollingerUP[20]

    Based on the above codes, may i know how the crosses are physically presented on  charts.

    I have a strategy where some of the crosses are not being considered as crosses though they look very similar to the others that are added as being crosses.

    The following screenshot support my observations.

     

     

    #177176

    MyLongConditions is: previous Close is under previous Bollinger Down and current Close is above Bollinger Down

    MyShortConditions is: previous Close is above previous Bollinger Up and current Close is below current Bollinger Up

    In your first example, there is already an opened order, you might have a condition to prevent new order if one is already present? Second example, I dont know what’s happening, better to analyze the whole code to get a real idea of whats going on on that particular case.

    #177206

    Hello Nicolas,

    Thanks for the information, but I dont remember applying any condition to prevent new order if one is already present.

    Please see below my strategy and advise accordingly:

     

     

     

    #177214

    Add Not OnMarket to your conditions:

    #177227

    Hello Roberogozzi,

    Am sorry , adding AND Not OnMarket to my conditions has rendered my strategy mute or ineffective, not even a single signal , no cross over or cross under for all timeframes and asset classes.

     

    #177228

    My fault, an order is likely to have been triggered but can’t exit.

    Remove Not OnMarket from the ELSIF line.

     

    #177307

    You may want to use the “graph” command in probacktest to visualise data in a specific window for debugging and/or investigating unexpected behaviour, in order to find out if it’s a platform bug, or a user code bug, or not a bug but a misplaced expectation, etc… Here with adding as last line:

    it shows the cross in 2nd circle is detected on July 9th.

    In case you were expecting a short position to open there, then it wasn’t a cross detection issue, it was about “sell” vs “sellshort” commands. Sell (used in your above code) exits an existing long position. Sellshort (not used in your above code) initiates a short position.

    https://www.prorealcode.com/documentation/sell/
    https://www.prorealcode.com/documentation/sellshort/

    (not entering into further details of when there is or isn’t an opposite position already open and being reversed rather than just exited, or when defparam cumulateorders = true or false settings is used)

    #177316

    JC_Bywan,

    Thanks very much for the information.

    But if you follow the thread from the beginning,  Nicolas already asked whether i apply conditions to prevent new orders when one is already present and my reponse is NO. Now i have even provided my codes to you where you are able to confirm there is no such conditions so am confused you are making reference to that fact.

    Or if what i have stated above do not represent the meaning of your information then can you please explain what you mean by : “Sell(used in your above code) exits an existing  long position.”

     

    Regards

    #177340

    Sell is the instruction used to close buy order, while Sellshort is the one to open a sell order.

    1 user thanked author for this post.
    #177342

    not even a single signal , no cross over or cross under for all timeframes and asset classes

    Try below and it may trigger orders using the values you show in your conditions.

    Also, don’t you need SellShort (in place of Sell) at Market at Line 22?

     

    #177345

    Attached might encourage you?

    #177349

    Hello Nicolas,

    Many thanks for providing more insight.

    So if Sell is the instruction used to close buy order,  does it then follow that for bollinger upperband cross to become a signal (Sell in this case), then there should have been already in existence a corresponding bollinger lowerband cross signal (Buy). It also follows that in a setup where there are 1 lowerband cross signal(Buy) followed by 3 successive upperband crosses, only one of these 3 crosses will become a Sell signal to close the earlier 1 Buy signal, the remaining 2 crosses will not qualify for signal . Am i right?

    #177400

    Yes … we can only Sell (Close a Long) if we have a Buy / Long trade open.

    Am i right?

    Yes … the remaing two crosses / Sell signals will do nothing if there are no open Longs to Sell / Close.

    #177875

    @Grahal, thanks very much for the education, appreciated.

     

    1 user thanked author for this post.
    #177888

    Hello,

    I also need help to explain the attached screenshot where there are 5 consecutive Buy signals followed by 2 consecutive upperband crosses.

    Only one of the upperband crosses converted to Sell signal to close one of the 5 Buy signals, leaving the other  upperband cross as just a cross. Does it mean the remaining 4 Buy signals have been cancelled.

    Also may i know whether it was the 1st, 2nd, 3rd, 4th or the 5th Buy signal that was closed by the Buy signal.

    Regards

     

     

     

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

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