ProOrder and PositionPerf

Forums ProRealTime English forum ProRealTime platform support ProOrder and PositionPerf

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

    ProOrder appears to not respect / act on PositionPerf < – ?

    Attached:

    First image from ProOrder shows (as most recent trade) a Long losing during a downturn.

    Second image backtest (same code copied direct from ProOrder which gave the first image) shows the same period, but with a long reversal to a Short and then back to a long.

    The reversal condition is below.

    It appears that ProOrder is not respecting PositionPerf < -0.009

    There are several other instances of PositionPerf < -0.009 not being respected on the same System when compared to backtest of the exact same code.

    I am posting this in case others are having the same problem??

     

    #239750
    JS

    I’m not sure if it hasn’t been working recently, but not long ago, I used “PositionPerf” as a kind of emergency stop in a “Long only” system…

    I used it like this:

    If PositionPerf*100<PP then
    Sell at Market
    EndIf

    Where “PP” was an optimization parameter (in %) that could also be negative…
    I believe it worked well at the time…

    2 users thanked author for this post.
    #239752

    Yes thanks JS, maybe ProOrder doesn’t like reversal from Long to Short with PositionPerf.

    I need to go back now and check similar conditions reversal from Short to Long … as I’m sure that was working fine with PositionPerf.

    #239758

    Hi GraHal,

    With Reversal more things go “wrong”. For IB different than with IG.  I can’t help you with solutions because they are all specific for the issues. I can give a hint though :

    With Inversion and for IB, you can see by means of manual trading that it is PRT which does the inversion. Notice that IIRC for IG there is not even such an “Invert” command on the chart.  What you would notice of it, is that you’d require double the money for such a trade (while real Reversal would net out). Anyway, because this is so, it can be expected that with AutoTrading it is the same. This in itself incurs for various strangenesses, like for IB adding the Commission in between (yes, this is visible as a separate trade !). While for IG not in order (for CFDs), don’t ask me what *does* happen. All I know is that my code is historically full with “Reverse” counter-acting.

    Below a 1:1 screen copy of what I find in the code accidentally on-screen. The hint in there is the usage of StrategyProfitPrev which you also see referred to in the comment. In some code somewhere, this has been worked out with comments and all (no idea where this code is – sorry), but the gist of it is that PositionPerf[1] brings off results, which is – or can be related to that in between real trades happenings, actually invisible to you (but they can be found).

    Does this help you ? surely not ! But still you may get the hang of how to approach PositionPerf and that in some “light” occasions it could be better to keep track of the Position Performance yourself.

    Also don’t underestimate what’s desired from the broker if it is indeed PRT doing the reversal (thus for Long, first Sell then Sell Short). This in itself is prone to error (broker and further chain can not digest it timely), though it won’t be what is bothering you right now.
    I think, but not sure, that I never apply Reversals any more, just avoiding as many throw-outs as possible (which goes quite well lately for me). Thus then rather : one bar out, the other bar in.

    Peter

    2 users thanked author for this post.
    #239760

    When you graph positionPerf [white] in backtest it appears to do what you expect, but it can be hit and miss if   with a running demo trade.

    As far as I can tell, positionPerf is calculated by ((tradeprice-close)/tradeprice) [green] but get a deviance at times when graphed together.

    If you look at the value when they deviate, the values are the same but with a sign difference.

    This appears to happen on the bar of the backtest position indicating the sellshort exit of trade.

    Can’t think of anything that can  causes this other than instrumentation and not able to display the same at that point due to timing.

    PRINT gives the same values but not the last when trade is closed.

    The [red] line is the positionPerf  at entry and the [violet] are the two threshold level up and down.

    I tried < and > , <= &>= , and cross over and under but didn’t notice any difference with running trade or exit consistency.

    I’m currently out of idea’s on this one.

     

     

    3 users thanked author for this post.
    #239851

    Careful here please :

    What I did not mention (there is a lot to mention and think of !) is that the behavior of adding Commission *after* the exit as a separate trade, does not occur in Live. Worse : in Live we don’t see a thing of Commission whatsoever (and please note that this is about PRT-IB only). So regarding this phenomenon, it is quite impossible to perform backtests which rely on PositionPerf (I managed, but it is crazy stuff). Thus, might you have gotten hold of the behavior(s) of PositionPerf by means of backtesting and what you showed/tried, @druby, then in real Live this would be worthless.

    And to have even more fun : the adding of Commission during Backtesting, also changes the TradePrice and TradeIndex. So for that too provisions need to be made in your code.
    Now try to create a system with accumulating orders. Really great fun. Not.

    With PRT-IG we are no bothered by this (no Commission assumed).

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