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 NullPointStrategies, Today, 05:17 AM
    0 responses
    51 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    127 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X