Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Making an update once per interval

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Making an update once per interval

    I have an algorithm that picks the value of a moving average for its entry point. It does great. As volatility swings the MA around during that bar, it submits a new order as the bar updates. I'm checking the log and seeing probably 20 or 30 order updates per second. While that's cool and how awesome algorithms should work, is there a way to make the order update process happen once per time interval? Like once per second.

    varInterval = 1 (second)

    Something like
    if time = time + varInterval
    enterlonglimit = moving average

    [syntax obviously not correct just laying out logic flow]

    The issue is that I'm having my algorithm and NT8 just "poop its pants" and starts to say there's an order but not. Then sync changes to false. The whole day is wasted because at Market Open + 30 seconds NT8 Desktop couldn't handle the order flow. I'm wondering if this will help at all or if NT8 has the capacity to handle this sort of load.

    #2
    Hello alphatango,

    Thank you for your post.

    OnOrderUpdate() is called every time an order changes state:


    If you currently have your order updating on each tick or each change of price, then it would be expected to have potentially frequent updates depending on the price action. With your example of varInterval, you could likely do something like create an int and use that in comparisons of ToTime(DateTime time):


    What type of data series are the orders being submitted on? Is it just the primary series or do you have a specific added series that they are submitted to? You could consider ToTime(Time[0]) to get the int value representing the timestamp of the current bar, but if you are using something like 1 minute bars than the timestamp would only change for each new 1 minute bar. If you are submitting orders to a more granular series, such as 1 tick, then using ToTime(Time[0]) could work to check if a specified minimum number of seconds has passed. Otherwise, you may need to consider using DateTime.Now which offers the current system time but wouldn't be useful in historical processing. Please provide a snippet of your code so I may better understand and assist you with a simple example.

    I look forward to your reply.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    89 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X