NexusFi: Find Your Edge


Home Menu

 





Getting the "OnBarUpdate()" method to actually execute once every second . . . .


Discussion in NinjaTrader

Updated
    1. trending_up 3,356 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
jmejedi's Avatar
 jmejedi 
Lilburn, GA
 
Experience: Beginner
Platform: NinjaTrader
Broker: VelocityFutures/TT
Trading: ES
Posts: 62 since Jan 2011
Thanks Given: 13
Thanks Received: 4

Fellow NT brothers & sisters,

I am having the following situation:

I want my strategy to execute the OnBarUpdate() method once every second , that is , for each second that passes , I want my strategy to call the OnBarUpdate() method ............ but here's what I am noticing ......... say ,,,,, for the M6A instrument ....... where trading volume is low ................. I put my strategy on a chart of 1 second . . . . . . . . . so I am expecting that my OnBarUpdate() method will be called every 1 second ....... but that's not happening ....... because apparently for the M6A instrument on a chart of 1 second ... its not always the case that a bar updates once every second ............. so I have this problem .................. how do I get my OnBarUpdate() method to actually execute once every second ?

Thanks in advance for any help you may provide,
- Jimmy


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
White House Drops First Alien Files Today -- Market Says …
Prediction Markets & Event Contracts
More Than Capable: Hegseths War Warning Validates $114M …
Prediction Markets & Event Contracts
Probability Collapse: Bitcoin $150k Craters from 15% to …
Prediction Markets & Event Contracts
$24.5 Billion Record Month: Prediction Markets Shatter A …
Prediction Markets & Event Contracts
After $87M Settles NO: Irans Nuclear Redline Sets Up the …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
22 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
5 thanks
  #3 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Legendary Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,951 since Dec 2010
Thanks Given: 3,042
Thanks Received: 2,397


Hi,

I haven't done it yet, but started looking into the problem myself for LOM as I had the same problem. Wanted aX second life on an order for example.

You need to setup a Timer that fires and event to:
TriggerCustomEvent(CustomEvent customEvent, int barsIndex, object state)

Here is the direct link in the NT manual:
TriggerCustomEvent()


Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: [wiki=NT-Local-Order-Manager-LOM-Guide][/wiki]
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on March 15, 2012


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts