Prevent entry near pivot points

Forums ProRealTime English forum ProOrder support Prevent entry near pivot points

Viewing 7 posts - 1 through 7 (of 7 total)
  • #141997

    Hi Guys, hope everyone is well.. loving how informative this platform is..

    Was curious if anyone would kindly help me code a condition as part of a strategy.. and that is to prevent orders being opened when they are in close proximity to a pivot point..
    e.g. No longs within 5 points of R1, R2, R3
    e.g. No Shorts within 5 points of S1, S2, S3

    These are key reversal points, or where lots of bids are stacked and I find that majority of my losses come from when the automated system enters close to these.

    Simply put, the strategy would be superior if somehow it could determine these areas.

    Would love some help, albeit I am very very basic, only just picked this up last week so apologies in advance.

    1 user thanked author for this post.
    #142006

    The below code could work for this purpose, I let you analyze it, i did not test it, it is just a quick rough version:

     

    1 user thanked author for this post.
    #142059

    Above added as Log 233 here …

    Snippet Link Library

    Thank you for beating me to it Nicolas! 🙂

    #202606

    Hello,

    I just tried to use this code, but the system displays an error message of line 25 and suggests that I use endif rather than floor, which does not make sense. 

    Do you know if this code works?

     

    Thanks !

    #202609

    Hi,

    floor (and ceil too, ligne 26) were introduced recently as reserved keywords of the language, year of this code 2020 sounds old enough to be “before” they became reserved keywords, so they used to be ok as variable names but not anymore. They have to be changed to other names of your choice, for example you could replace them with “myfloor” and “myceil”.

    #202618

    Thank you indeed, but this code does not in fact give what I want.

    Actually, I think my problem is more complex.

    I am looking for a code that allows me to put a blocking condition so as not to enter position if my price is too close to a pivot point, say a distance of X points. I would like to consider the Daily Weekly and Monthly pivot points.

    The code that I have just created attached does not work, because I do not know how to code how the different levels are positioned between them, and to determine those which frame my price at the moment.

    Indeed, the order of the pivot points is then no longer at all obvious and my price can be found for example S1 Daily and S2 Weekly depending on the configuration of the moment.

    I hope my question is clear, and if anyone can help me out that would be great.

    Thanks!

     

     

    #202658

    Much better approach with help of variables in array. We store all pivot points into an array, and the fetch it to check if the current price is near of the pivot point, if that’s the case we do not allow any order to be opened.

    You can fill the array $p with any other pivot points from any other time horizons (such as weekly, monthly, ..)

     

    1 user thanked author for this post.
Viewing 7 posts - 1 through 7 (of 7 total)

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