Two positions with CumulateOrders = False

Forums ProRealTime English forum ProOrder support Two positions with CumulateOrders = False

Viewing 14 posts - 1 through 14 (of 14 total)
  • #55713

    I noticed this this morning on a live strategy and again tonight on the same strategy running on demo. The system clearly shows two positions open and two being closed on more than one occasion with CumulateOrders set to False. In reality it appears that only one position is opened but it makes the results/performance analysis worthless.

    How is this possible?

    #55715

    It might be due to insufficient liquidity, if at the best price you want to buy only a portion is available, then the rest needed to fill the order may be entered at another price.

    That’s mere speculation, I’m not aware of the policy of PRT/IG about this. Also, this should only happen, if ever, in real mode not in demo mode!

     

     

    #55717

    I have had problems with this command, too, but the other way around. In one backtest, I noticed that a few orders were NOT carried out, when I had “cumulateorders = false” at the beginning of the code, although they should have been, because there was NO position in the same direction open at the time. When I removed  “cumulateorders = false”, everything went fine. I have not experienced this in live automated trading, though.

    It appears that “cumulateorders = false” is not 100% reliable, and prorealtime should look into this command. 

    For the moment, it may raise safety, when you add to all buy or sellshort commands the following conditions :

     

    If not longonmarket then

    buy 1 contract at market

    endif

    or 

    If not shortonmarket then

    sellshort 1 contract at market

    endif

     

    I have this in all my codes all of the time, without problems. Cumulation does not occur. 

    2 users thanked author for this post.
    #55743

    If not longonmarket then buy 1 contract at market endif or If not shortonmarket then sellshort 1 contract at market end

    I Have exactly this in the strategy except ‘PerPoint’ instead of ‘Contract’ and yet the strategy still shows that it opened 2 positions on several occasions with CumulateOrders set to False – in both demo and live. So both instructions have been ignored.

    #55746

    Can you please try what happens when you leave the “cumulateorders” command away entirely, both with the condition set to “false” and “true” ? In my case, the system made no mistakes, then. Would be very interesting !

    #55747

    Of course, I meant for both code cases : cumulation desired or not. 

    #55749

    Bear in mind that code is read from top to bottom, and to test if an order is on market, we need at least 1 bar.

    #55750

    Sure, but in the image he shows, there are about 20 bars between the first and the second (cumulative) order.

    #55755

    This should work without having to wait for the closing of the first candle to check if OnMarket:

     

     

    #55756

    Yes, I use something similar in my codes, too. The “IamAlreadyTrading” parameter also avoids that more than one buy or sellshort order will be executed in one bar, if there are many of them. I set the parameter “IamAlreadyTrading” to 0 at the beginning of the next bar and always check for “longonmarket” or “shortonmarket” in addition.

     

    But, nevertheless, there is probably a small bug in the “cumulateorders = false” command, and someone at prorealtime may want to check this. 

    #55757

    But, nevertheless, there is probably a small bug in the “cumulateorders = false” command, and someone at prorealtime may want to check this.

    In my mind if CumulateOrders = False is at the start of a code then at no time should it be possible to open two positions at the same time. All the other stuff with Not LongOnMarket and snippets of code to double check we are not already on the market are unnecessary belts and braces. Well they would be unnecessary if I had not seen what I have posted in the image. In real life two positions were not opened but it makes the mind wonder what could possibly happen and it appears that the belts and braces are useless and there is the potential for us to find ourselves with our trousers around our ankles – metaphorically speaking. 

    At the moment it is a backtest and running strategy results bug only – but one I think needs killing ASAP before it gets into someone’s wallet! Backtest and forward test results are useless if they do not do what it says in the code.

    #55762

    In my mind if CumulateOrders = False is at the start of a code then at no time should it be possible to open two positions at the same time. All the other stuff with Not LongOnMarket and snippets of code to double check we are not already on the market are unnecessary belts and braces. Well they would be unnecessary if I had not seen what I have posted in the image. In real life two positions were not opened but it makes the mind wonder what could possibly happen and it appears that the belts and braces are useless and there is the potential for us to find ourselves with our trousers around our ankles – metaphorically speaking. At the moment it is a backtest and running strategy results bug only – but one I think needs killing ASAP before it gets into someone’s wallet! Backtest and forward test results are useless if they do not do what it says in the code.

    Simply true, no matter what!

    #55770

    In my mind if CumulateOrders = False is at the start of a code then at no time should it be possible to open two positions at the same time. All the other stuff with Not LongOnMarket and snippets of code to double check we are not already on the market are unnecessary belts and braces. Well they would be unnecessary if I had not seen what I have posted in the image. In real life two positions were not opened but it makes the mind wonder what could possibly happen and it appears that the belts and braces are useless and there is the potential for us to find ourselves with our trousers around our ankles – metaphorically speaking. At the moment it is a backtest and running strategy results bug only – but one I think needs killing ASAP before it gets into someone’s wallet! Backtest and forward test results are useless if they do not do what it says in the code.

    Simply true, no matter what!

    Very true ! So, Nicolas, can you please report this issue to Prorealtime ?

    “cumulateorders = false” obviously has 2 different issues :

    Sometimes, cumulative positions ARE opened, although they should not, and sometimes “cumulateorders = false” suppresses correct orders that should be executed, but are not executed in reality. Not good for a command that suggests reliability !

    #55783

    It is still doing it. I just checked in to my demo account and the same strategy has opened lots of bets today with double positions despite CumulateOrders = False! Screenshot attached. I have stopped the live version as it made a big loss yesterday during the bank rate decisions which does not appear on the demo version. Very worrying as up until now the two versions have backtested identically on PRT Demo and PRT Complete. I’m guessing the difference in returns is due to the fixed spread on backtesting and the varying spread on live testing (another strategy hits the dirt due to that damned fixed backtesting spread!) – but this does not explain the multiple positions at all. 

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

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