Since ProOrder nedds one bar to detect whether you are OnMarket or Not, maybe it needs a bar to detect correct strategyprofit.
Why, stll executing trades on a 1-minute TF, don’t you add (and switch to) a 1-second TF to graph STRATEGYPROFIT?
To me it looks like it is just not seeing any trades that are closed mid bar. Switching to 1 second will mean they still close mid bar so it should make no difference. All trades closed at the close of the bar are being seen it is just mid bar closures that are not.
It might be interesting to change the STOP orders to SET orders and see if they are seen.
Defparam cumulateorders=true
Buy 1 contract at close + 60 * pipsize limit
Sellshort 1 contract at close - 60 * pipsize limit
Graph STRATEGYPROFIT
All trades that have SET a sl or tp will be closed mid bar!
I just tested the piece of code above on Dax daily and ProOrder updates STRATEGYPROFIT correctly, apart from the last day which is not closed, yet.
Sorry, STOP instead of LIMIT Orders, or keep LIMIT but exchange “-“ and “+”.
I just tested the piece of code above on Dax daily and ProOrder updates STRATEGYPROFIT correctly, apart from the last day which is not closed, yet.
So then it must be something strange in the OP’s code but as we have not seen that yet it would seem that further analysis is impossible. If he does not want to share on it on here then he might get an answer from PRT if he sends a report in with access to the code to them. I suspect that it would be quicker to share on here.
Sorry if I missed something, but since code is read at Close, STRATEGYPROFIT is computed once also at Close, that’s why you don’t see it changing values between 2 bars.
I’m also seeing a problem with strategyprofit with cumulating orders.
In the attached pic (the function “graph strategyprofit” is the graphed variable) I have a trade (#2) that opens and closes before the initial trade (#1) finishes, but strategyprofit doesn’t seem to capture this profit?
This is an automated strategy, so it’s not a partial close – but it seems like strategyprofit only computes once you’re totally off the market.
I’ll have to see if I can overcome this with another calc somehow and not rely on this function then I guess.
Finning
I’m sure the question has been asked before – I just haven’t been able to find the answer to it – but is there any way to access the ProRealTime generated value for the Equity Curve?
I’ve seen it suggested in various places that you have to calculate your own equity curve – e.g. – something like:
myequity = (((close-positionprice)*pointvalue)*countofposition)/pipsize + strategyprofit
Which is what I normally do to generate this value.
But if strategyprofit isn’t working because of the reasons mentioned in the post above, it throws this all out.
I will mention that in the post above, I’m using
set target profit 10
to exit, and I’m not using any other limit orders.
Hard to do a fixed fractional reinvestment system if you can’t properly simulate equity…
Thanks,
Finning
Sorry – to re-iterate if I wasn’t clear – in the photo above that I attached – that gap in strategyprofit that is denoted by the green arrow – is never recovered when it bumps up after the next trade is closed. So much so that at the end of my test period, my standard prorealtime equity curve says +7000, and my calculated equity curve based on strategyprofit is +1900. So that is a huge difference that that I’m missing out on/not seeing for calculation purposes into redistribution. I know that strategyprofit only updates once all positions are closed – it’s the trades that it’s not collecting information for that is causing me problems.