How to find trade date?

Forums ProRealTime English forum ProOrder support How to find trade date?

Viewing 3 posts - 1 through 3 (of 3 total)
  • #201465

    Hi all,

    I feel like this should be an easy one but seeing as I’m normally fairly adept on PRT I think I’m either massively overthinking it or its just impossible (ha!) So here goes;

    I have a trend following system that on any given day produces trade results heavily inline with previous trades of the same day (Z-score of -31!). Great when it’s profiting, awful when its losing. To combat this I want to stop the system trading for the rest of that trading day (only) after an arbitrary number of losing trades (we’ll use 3 but once I have the code I’ll clearly refine this).

    I’m assuming the ideal code would look something like this;

    The issue is of course, that neither a TradeDate function, or Position/Trade number function exists (unless I just can’t find it?). I can of course figure out how to stop it running based on the past three trades being losing trades, however the important part is these trades are only relevant if on the current trading day.

    Any ideas or workarounds?

    TIA!

    #201466

    OK.. so having just typed that out I’ve thought of a not-that-great workaround..

    Noting this is for US markets and 10min candles, so 39 candles per day, I guess I could do the following;

     

    Would that work? Can anyone think of any improvements?

    TIA!

    #201493

    This code will limit losses (defaults to 3):

    Comment out line 9 to not require consecutive losses.

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

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