how to delay an order in milliseconds

Forums ProRealTime English forum ProOrder support how to delay an order in milliseconds

  • This topic has 5 replies, 2 voices, and was last updated 5 years ago by avatarPaul.
Viewing 6 posts - 1 through 6 (of 6 total)
  • #146494

    Hi,

    Is it really possible to delay an order in milliseconds? Because this could be useful when testing similar strategies which open a trade in the same direction simultaneously. Possible that one gets rejected. By adding a time delay, like 100-500 ms in one strategy, the order is still opened in the same bar.

    Could someone please advise how to code that correctly if even possible? Thanks.

     

     

    #146499

    No, you can’t. There’s no provisions for planned delays.

    You could only delay minimun 1 second, using MTF support and 1-second TF. You could delay each strategy with a defined different second unit (not tested):

    your next similar strategy on the same instrument could use second 2.

    If 1 second difference is too high, then you have to give up. If it’s too little you can set the delay to a multiple of 1.

     

    2 users thanked author for this post.
    #146500

    Sorry, use CurrentSecond (OpenSecond does not exist), but there’s no guarantee there’s a bar each second.

     

    #146503

    You can also tell the correct second unit with:

     

    2 users thanked author for this post.
    #146505

    Thanks robertogozzi. Yeah when there’s no bar the next second is another problem of it’s own. I will give your code a try.

    #146608

    So the goal was to have identical strategies running the same index in the same direction more correctly for the entry.

    “ve tested it for a day and it seemed in general to work fine.

    Strategy running on 1 sec, with mtf using 2s. When a signal comes, entry is on the first sec and in another strategy entry is on the second sec.

    Also tested the difference with and without updateonclose.

    If there’s no bar on the one second timeframe hopefully the order will be repeated at first or later rejected. Not completely sure about that.

    Another way to avoid conflict is using 1€, 2$ and 10$ charts I guess, still this was an interesting experiment.

    Here’s the test file for anyone interested.

     

    2 users thanked author for this post.
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