coding help about buy and sell on certain days of the month

Forums ProRealTime English forum ProOrder support coding help about buy and sell on certain days of the month

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • #46506

    Hi there,

    I am a new ProRealTime user and just working my way through the programming manual in order to get to grips with the programming language!

    It would be ever so helpful if someone could tell me the correct code for the following – it would help with my understanding of how the specific monthly date element of coding works:

    Buy on the last 2 trading days of the month and sell at the close on the 3rd trading day of the month

     

    If someone would be kind enough to tell me the code for the above lines, it would help me as I work through the ProRealTime coding manual.

    Many thanks for your help!

    Rob

    #46525

    I wrote functions to know if we are on the last day of month for someone else, here are the codes:

    This indicator will tell you the number of the last traded day of the current month (save it as an indicator named “#lastdayofmonth”):

    This code above need this other function (saved as an indicator named “#get_lastdayofmonth”).

    So in your strategy, you’ll have to code something like:

     

     

    #46725

    Many thanks Nicolas, that’s helped me get to grips with things!

    #112415
    Bel

    Hi Nicholas.

    I’m interested in buying or selling at start or end of the month but have no idea how to code it right except manually enter dates. Any help possible?

    P.s. tried this code but can’t get to work 🙁

    #112419
    Bel

    Hi Nicholas.

    I’m interested in buying or selling at start or end of the month but have no idea how to code it right except manually enter dates. Any help possible?

    P.s. tried this code but can’t get to work 🙁

    I think I worked it out right after posting. All good. Lets see how it rolls.

    #164512

    If, like me, you’d forgotten how to pass parameters to indicators, this is very helpful: https://www.prorealcode.com/blog/video-tutorials/adding-dynamic-parameters-to-your-indicators-prorealtime/

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

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