Help with loop code: bollinger bands touch down then up

Forums ProRealTime English forum ProOrder support Help with loop code: bollinger bands touch down then up

Viewing 11 posts - 1 through 11 (of 11 total)
  • #142984

    Im a complete novice and am learn from the videos. Even bought and watched the advanced videos. Im having diffuculty excuting a loop code.

    Im trying to have the code that detects when the prices closes below the bollinger and then closes above the bollinger – in just this two part sequence.

    Can someone help me with the template of the code and if it is even a loop code or not?

    Thank you in advance

    #142989

    There you go:

    The variable FOUND, if <> -1 retains the bar ID where the event most recently occurred.

    1 user thanked author for this post.
    #143001

    Thank you for your reply.

    It is my fault, i meant to say when prices closes below the lower bollinger and then (any amount of periods later) closes above the upper bollinger – buy.

    I will try to use the IF NEXT structure you provided to try to make it work.

    #143003

    There you go:

     

     

    2 users thanked author for this post.
    #143004

    There’s no need to use LOOPS, just wait close < BollDOWN then start triggering, as soon as it closes above BollUP you can enter Long.

     

    1 user thanked author for this post.
    #144829

    Hi again, i cant seem to get the code working perfectly. Most of the trades are working then some odd trades happens that goes against my code. It makes trades below the bollinger.

    Im trying to make it work by the code you have given me plus –  bollinger above 200ema as core.   (Experimenting with the other indicators.)

    This is my code:

    Any advice of what im doing wrong? Much appreciated.

    thank you

     

     

    #144830

    Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.

    Thank you 🙂

    #144831

    To be able to replicate your trades you should post the complete code, not just the strategy.

    Moreover we need to know:

    • instrument traded
    • TF used
    • date and time of at leasr one bar where a traded was entered incorrectly.

     

    #144832

    Sorry i thought i had attached a screenshot before. ill try again now

    5min tf

    eur/usd

    Examples in the screenshot

    #144852

    You are never resetting the triggers variables, so they last forever in their actual states until “trigger3”, then the order is executed at next bar open.

    1 user thanked author for this post.
    #144927

    How do i reset the variables?

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

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