StrategyProfit function stopped working

Forums ProRealTime English forum ProOrder support StrategyProfit function stopped working

Viewing 15 posts - 1 through 15 (of 21 total)
  • #191388

    Hallow forum,help me.

    StrategyProfit function stopped working. It does not work properly.
    It seems to return a smaller value than it should be.

    – real trade, prooder autotrade.
    – IG (Japan)
    – USD/JPY
    – maybe from about March 2022,It worked properly until then.
    – It still work properly on back test.

    I use this function to adjust lots.

    For example,if sysytem loses 50,000JPY, STRATEGYPROFIT should return 50,000 and NumOfTrade should be 41.
    but actually the system orders 41.99 lot. WHY?

     

    #191398

    Hellow forum,help me.

    StrategyProfit function stopped working. It does not work properly.

    It seems to return a smaller value than it should be.

    – real trade, prooder autotrade.

    – IG (Japan)

    – USD/JPY

    – maybe from about March 2022,It worked properly until then.

    – It still work properly on back test.

    I use this function to adjust lots.

    <!– Crayon Syntax Highlighter v_2.7.2_beta –>

    <!– [Format Time: 0.0002 seconds] –> For example,if sysytem loses 50,000JPY, STRATEGYPROFIT should return -50,000 and NumOfTrade should be 41.

    but actually the system orders 41.99 lot. WHY?

     

    #191400

    Why did you double post?

    Moreover, please do not quote yourself, it’s only you posting, I guess you know who posted!

    Thank you 🙂

     

    #191408

    sorry,I made a mistake.

    #191411

    Hello @yasuhisa,

    Good that you repeated the question because now I suddenly have an idea – two actually :

     

    1. In your FX pair the JPY is the one subject to change. Thus, when a larger change is implied, the result of your /50000 could suddenly be different from what you expect. Please notice that this is actually not related to the profit you make (you can make profit over Long and over Short).
    2. To me it seems that StrategyProfit/50000 *always* comes up with a fraction, and not an integer number. But somehow you imply it is integer ?
      I may add to this that buying lots is allowed to be in fractions anyway (for IG). So how would it have happened that the system ordered 42 exact lots vs. 41 exact lots ? I think that can not be so …

     

    Kind regards,
    Peter

     

    1 user thanked author for this post.
    #191418
    JS

    Hi @yasuhisa,

    Maybe this has something to do with it:

    StrategyProfit is normally expressed in the currency of your account BUT it can also be expressed in the currency of the instrument.

    When there is a difference between your account currency and the instrument currency then you must make a conversion.

    1 user thanked author for this post.
    #191441

    thank you for your advices.
    is it possible to force StrategyProfit expressing in the currency of my account at real trade?
    is it needed any command?

    I wonder why StrategyProfit behaves differently between real trade and back test….

    #191447

    I wonder why StrategyProfit behaves differently between real trade and back test….

    Interesting observation !
    I never saw that, but this will be because I accidentally don’t do things which would make me notice. But it will be the same as I told about : the currency (the value of it) itself changes, and we can expect that no backtesting developer (at PRT) ever thought about that. This even becomes logic when we see that in our code we have no commands for looking at currency pair rates (which I would highly need !), unless it is am Fx pair itself.

    When you work in real time, obviously the rate continuously changes.

    I hope I make sense ?

    #191448

    my account is in sterling but I trade in euros.

    In my experience, strategy profit is always reported in the instrument currency, both backtest and actual trading.

    Maybe this is different for FX ? ie dependent on which currency you are buying and which you are selling ???

    #191449

    is it possible to force StrategyProfit expressing in the currency of my account at real trade?

    Of course. If you define a reference at the start of your Strategy (when the Strategy is handed to the ProOrder system) and you make that a factor for the always changing rate …

    Something like

    Notice that this means should cover for the rate change throughout backtesting (-months) because you can use Close for the current rate (against USD in your case).

    I hope you can sort out the remainder yourself ?

    #191451

    my account is in sterling but I trade in euros.

    My account is in euros but I trade in USD. The account shows in USD.

    Here you see the importance. This is just an index.
    I want to trade (invest) 140000 (and not mysterious points). The “result” in order amount always changes. This is the same what StrategyProfit shows.

    I never sorted out whether StrategyProfit could be subject to the account setting for what currency to show.

    With Forex it is indeed more complicated but I forgot exactly how because I do all these conversions internally.

    When you have an other account in yet another currency (I also have accounts in USD) then you can get even more mad. And in all cases you’d like to compare (results).

    What you (OK, I) don’t want is see (jumping) results on a stock just because the currency rate of it changes. Of course this is some times unavoidable. So if I’d trade Dutch ASML the gain of it always changes. But I can use the USA version just the same.

    Undoubtedly there is more to say. Like my USD account(s) nicely growing because my normal money is in EUR. Ha !
    … but I recall worse times just the same …
    🙂

    #191458

    PS: Before nobody understands the last screenshots … I can hardly understand it myself. But this is because the asset itself also changes the price. And in this case (these markets) that also change wildly in a month’s time.
    And to add to the confusion : in this particular case, I wanted to keep the number of contracts equal always. So here it counter-acts against itself.

    More madness in the below. Same instrument, different PointValue. Same trade, but different currency (left USD, right EUR, at a rate which at this moment is 1.087 (which was obviously not so at 17:01 my time).

    Summarised, it already is confusing, but I can easily add to that. 🙁

     

     

    #191496

    Thanks everyone for your kind advices.
    I will try to modify my code as StrategyProfit returns profit in the currency of the instrument,and try it in real trade.

    #191809

    I modified my code as StrategyProfit returns profit in the currency of the instrument,and tried it on real trade.But the result is same.

    After  system lost 93,100JPY(=744.8USD),system ordered 41.99 lot.

    I strongly doubt that there is a bug in ProOder for the following two reasons.
    -On backtest,even now, STRATEGYPROFIT returns value in JPY(currency of my account).
    -STRATEGYPROFIT returned value in JPY on real trade until about March 2022. (degrade happened?)

    I would like IT-FINANCE engineer to analyze this isue.

    #191816

    Assumed that from your Mod(ulo) function comes something with sense, the above should buy 41 contracts.

    But this from your first post should do it too :

     

Viewing 15 posts - 1 through 15 (of 21 total)

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