Trades not opening at set time and strategy stopped but still running!

Forums ProRealTime English forum ProRealTime platform support Trades not opening at set time and strategy stopped but still running!

Viewing 15 posts - 1 through 15 (of 31 total)
  • #76899

    I have been carrying out a test with two strategies to try to confirm what the spread actually is at set times of the day. One opens a long position at set times and the other a short position at the same times and then they both close them a minute later. They are programmed to open positions on every half hour and every hour. I have had them running on demo on the DJI minute chart since yesterday at 1430 BST – so for over 24 hours now.

    During that time both long and short strategies failed to open positions at 1830, 2100, 2230, 0830, and 1100. There are no rejected orders in my order list so the orders were never even created.

    Then at 1230 both strategies stopped opening positions completely. They are still shown as running in the list of strategies but there is a black line on the performance graph equity curve. See image:

    Screenshot_1-13

    I’m thinking that they were stopped due to the following being set to 50:

    Screenshot_2-11

    …but that does not explain why they both failed to open several positions during the 24 hour period.

    I will send a report to PRT.

    The code was simply this and the opposite for shorts positions:

     

    #76925

    Another glitch you have uncovered and reported to PRT Vonasi, thank you!

    #76929

    Another glitch you have uncovered

    Yes and quite worrying one. To not open 5 trades out of I believe 38 on a 1 minute time frame when the strategy only has one condition (time) is quite a failing. I am sure there will be some logical reason why that I have not considered but at the moment I cannot think what.

    Personally I would never use time as a criteria in my decision as to whether to enter a trade or not. Time is never more important than price!

    The other issue of the strategy stopping I confirmed as having my orders limited to 50 as when I went back to the platform after posting and clicked on the running strategies window it updated and showed them as stopped and the reason given was what I suspected. I guess we still have the problem of that window going to sleep and not updating!

    1 user thanked author for this post.
    #76940

    Line 76 should read 003000 instead of 300000.

    Line 106 should read 103000 instead of 130000.

    Line 136 should read 203000 instead of 230000.

    With the above correction, backtesting it on EurUsd, 1 minute, from july 25th at 23:59 through July 26 at 23:59 opens exaclty 48 trades, as from attached screenshot.

    Thos code will yield the same results:

    and it’s a bit less time consuming!

     

    1 user thanked author for this post.
    #76954

    Thanks for pointing those typos out Robert – not sure why they are in there and I don’t think they can be in the code I ran live as it opened trades at 0030 and 1030 but did not open one at 0830. I will have to double check.

    While writing it I did think there must be a shorter way to write this but with cut and paste and find and replace it would have taken longer to think of the idea than to just get on and do it so I just got on and did it – but the find and replace may be why there are some typo errors!

    Back testing works fine but the issue is that when running live it failed to open trades. I will double check the code and see what typos were in the ones that I ran.

    #76958

    Robert – Your code should use MINUTE rather than OPENMINUTE otherwise the trades are not opened on the hour and half hour exactly but a minute later.

    I checked the codes that I ran and there were the typos in there. Here are two images of the trades opened and it clearly shows trades opened at times when there were typos in the code.

    So the strategies opened live trades at 0030 1030 and 2030 when they should not have done and failed to open trades at 0830 1100 1830 2100 and 2230 when they should have done.

    Screenshot_5-4
    Screenshot_6-4

     

    1 user thanked author for this post.
    #76965

    So the strategies opened live trades at 0030 1030 and 2030 when they should not have done and failed to open trades at 0830 1100 1830 2100 and 2230 when they should have done.

    Just so I am clear … is above the case with Roberto code also (with minute instead of openminute)?

    #76966

    Just so I am clear … is above the case with Roberto code also (with minute instead of openminute)?

    I would need another 24 hours to run Robertogozzi’s code live! I’m not going to do that just yet as I think it will just add confusion. The code I wrote should not have opened some trades and did not open other trades that it should have. I think I’d rather wait for PRT to respond before confusing things any further with a test of a different strategy.

    Also when I run them – it makes my demo account balance look terrible! Maybe you could run it on yours?

    #76967

    Maybe you could run it on yours?

    Yeah I will, I’ll run Roberto code! Good call! 🙂

    #76969

    Don’t forget to run one short and one long version and then you can check the spread every half hour. I found no errors and no slippage in the results that I got.

    #76977

    Are you running the test code on real account (live) or just backtesting it?

    I just backtested my code (with minute instead of openminute) with both BUY and SELL and 48 trades have been opened/closed, on my real IG account, pasting them to eXcel didn’t outine any spread (difference in price), but there’s no evidence of spread, I guess backtest doesn’t care about it.

    See the attached pics (partial results) and .XLS file (full results).

     

    #76981

    Live on demo – it was a test to gather live long and short entry prices to test when spread actually changed and whether it actually was what the brokers say it should be.

    https://www.prorealcode.com/topic/when-does-spread-actually-change/

    #77162

    Maybe you could run it on yours?

    Yeah I will, I’ll run Roberto code! Good call! 🙂

    Did your 24-hour test complete  (I have 25 strategies running on Demo and cannot add more, still have some in the queue waiting)?

    #77175

    I have 25 strategies running on Demo and cannot add more

    You need to open some extra IG/PRT accounts to run extra demo platforms on. I have two accounts and also my girlfriends account so I get to test 75 strategies at the moment. I suspect that one day IG will shut one of the accounts down for lack of use with live trading (they have done this to me before!) so I might have to do the odd manual trade if I want to keep it going.

    The 25 strategy limit on the demo platform is ridiculously low for our forward testing needs in my opinion. It should be the other way round – we should have 25 for live trading and then pay for more slots if we need them and 100 for demo trading. It is obvious that most people will have more strategies on test than they will have running live – or do PRT/IG actually want to rush us to put untested strategies live too soon? I think they might have an interest in that happening!

    #77184

    Thanks Vonasi, I’ll try to open one on my daughter’s name.

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

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