Oil daily problems

Forums ProRealTime English forum ProOrder support Oil daily problems

Viewing 8 posts - 1 through 8 (of 8 total)
  • #234333

    Hi

    I have an algo that trades oil on a daily chart. I have this problem that oil is closed the hours 00:00-02:00 Tuesday-Friday, but my algo tries to take a position at 01:00 a clock which results in a error and that the algo shuts down. When I do backtest there is no problems but live it does not work. I tried the solution to limit the hours the algo can trade to not take a position before 02:00 but this results in 0 trades.

    There must be some easy fix that I am missing

    #234334

    Try below re the tradeon flag

    #234335
    #234336

    Yes I have tried both solutions from @GraHal and @druby, and the result will be the same, the algo makes 0 trades. I have the same algo running on daily for naturalgas with no problems, as naturalgas dont have this 2h break between 00:00-02:00.

    #234337

    Aha my idea wont work on Daily TF anyway, because there will be no 1 hour bars for the condition Time > 000000 AND Time < 020000 to be true!

     

    #234338

    I’m not up to speed in running algo’s, so this may be at bit of BS.

    I started scratching head when you mentioned, ‘Market closed’ and ‘ tries to take position’.

     

    @GraHal brings up a good point.

    If your algo is on daily, and lets say the code only action’s events at the close of a daily bar,

    then does that mean that even if the code recognised the market was in the closed area,

    it couldn’t action the change till the end of a bar, whereby the halt condition is no longer true.

    And therefore, setting an halt at the beginning of the day, and, with a change in the middle of the day, wouldn’t get actioned till the end of the day.

    Where it all repeats, possibly with no trades.

    This seems to explain while messing around with the time on daily, doesn’t give logical results regarding actions taken.

     

    Regarding , why it tries to take order when market shut, still scratching head.

    Unless you can make orders all the time, and get the error, if market shut.

    But, what made condition true…

    #234339

    What I think is happening

    1 Algo only buys on the open of a new candle
    2 Algo thinks new candle opens at 01:00
    3 Market is closed 00:00-02:00 so impossible to make a trade

     

    Sidenote: Back in March when US started Summertime before us, Brent was closed 23:00-01:00 so the algo worked fine then

    Attachment
    Algo trying to get a position every second for about 5 min before giving up

    Mb found a work around, looks like US-Crude don’t have this 2h break or any break at all and should work to trade on the daily

    #234341

    All seems to fall into place!

    regards

    1 user thanked author for this post.
Viewing 8 posts - 1 through 8 (of 8 total)

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