DAILY Reseting postionperf to ZERO.

Forums ProRealTime English forum ProOrder support DAILY Reseting postionperf to ZERO.

Viewing 13 posts - 1 through 13 (of 13 total)
  • #56916

    Hi all,

    I am trying to find the way to reset the function positionperf(n) to one day. If one day I have two losing operations, positionperf(1)<0 and positionperf(2)<0, I want the next day this function to be reset it to (1) again.

    Verdi55 showed me one way playing with the bar index, but I don’t get it, and I wondered if there is another way to reach this.

    Thanks,

    Juan

    #56917

    I think POSITIONPERF cannot be reset, it can only be affected by trades.

    You should use a variable and reset it each day, and update it at each new trade that is closed. It should not be straightforward, though.

    1 user thanked author for this post.
    #56919

    Roberto,

    Many thanks. Verdi55 found this original way but I don’t have it very clear:

     

    #56922

    Yes, that’s something I was thinking about.

    I will not be of any help for a few days, though and cannot test/write  any code.

    Try to study and test that code snippet.

    Let us know if you could find a solution worth while being shared.

    #56923

    Actually any solution is worth while being shared, if it’s good anyone can learn from it, if it’s a bad one the author could benefit from improvements and suggestions by members.

    #56926

    Hi Roberto,

    You are right. These days are to disconnect a bit from the codes 🙂

    I think I will take these days to work on this and will post the results.

    Many Thanks and Happy and prosperous 2018.

    Juan

    #56943

    Wouldn’t it be easier to use StrategyProfit?

    Record StrategyProfit and day / date then keep subtracting yesterdays StrategyProfit to start at zero again for each new day … or something similar? (My brain not woke up yet, coffee not got through! and I’ve not even been celebrating New Year! :))

    https://www.prorealcode.com/documentation/strategyprofit/

    GraHal

    #56951

    I agree, STRATEGYPROFIT could be a far better and easier  solution!

    #56959

    Hey Roberto, your words below are so good and true that you should add them under your Profile pic!? 🙂

    Any solution is worth sharing
    If good, we can all learn from it
    If bad, solution / author benefits from improvements and suggestions by members. 

    2 users thanked author for this post.
    #57082

    Juan Salas, I tried to implement GraHal‘suggestions, first you can write:

    At a later moment, when your, say, BUY conditions are met you can write:

     

    1 user thanked author for this post.
    #57084

    Hi Roberto,

    I think your solution above is more directed to monitoring daily operations through their dailyprofit. I don’t know if that can apply to what I am trying to get.

    I am working with different types of Martingale, and although no filter may “soften” the unexpected and statistically proven drop of the Martingale, I am trying different approaches.

    Example: I have a system that operates 3-4 times a day. Lets say I have 4 losing operations that day, and I want to apply a DAILY martingale. It means positionsize=1, 2, 4 and 8. Next day I want to start in positionsize=1. RIGHT NOW, each day starts as a continuation of the past day, in this case it starts with positionsize= 16.

    It is tricky, since positionperf(n) doesn’t differentiate past performances by dates, so it doesn’t matter if the last and losing operation was three days ago, it still counts as positionperf(1)<0.

    My intention is contain the Martingales within certain periods of time to avoid escalation (days and even periods of three-four hours). Probably, it may not work, but I want to know how to do it.

    In any case, thanks so much for your approach.

    Juan

    #57257

    Try to count the number of positions that you have openend every day. For example, set a parameter np to 0 every day at 0:00. When you open a new position, increase np by 1.

    Then you can consider positionperf only for the number that np is currently showing.

    For example, when np is 2, and a position is open, you consider only positionperf and positionperf(1). When no position is open, you consider only positionperf(1) and positionperf(2).

     

    2 users thanked author for this post.
    #57266

    Try to count the number of positions that you have openend every day. For example, set a parameter np to 0 every day at 0:00. When you open a new position, increase np by 1. Then you can consider positionperf only for the number that np is currently showing. For example, when np is 2, and a position is open, you consider only positionperf and positionperf(1). When no position is open, you consider only positionperf(1) and positionperf(2).

    Great idea, if NP = 0 you know positionperf(1) refers to previous days, if not then it reports today’s data. And you can easily reset it daily when IntrayDayBarIndex = 0.

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

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