Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Whatif there is no Bar activity?!
Collapse
X
-
Whatif there is no Bar activity?!
It seems that all ATM methods rely on some sort of Bar activity or an update of a sort. What if the ATM needs to place an order when there is no activity of any type? Say it's quiet after hours and it needs to place an order, then that order won't get executed until the next update of price etc on the chart?Tags: None
-
Thanks for the quick response. This is a little worrying since in such case the trader loses the opportunity to preposition himself or get in the Que!Originally posted by NinjaTrader_Bertrand View PostHi mktrend, correct the ATM needs to reach it's user set trigger prices to place / modify orders. Once they are placed market action will determine their execution, if you happen to trade after hours or in quiet environment, this can take some time.
I wonder why, the users can't raise an event in their code, any idea please? I wonder if as a bad alternative one could place a timer that say in the case of n seconds lack of updates to take whatever action like placing a trade but then when there is no update and your code does place an order, would it then go through or it still needs an update to occur to pass the trade?
Comment
-
Hi mktrend, not sure I follow - when you have a strategy that triggers an entry and then launches an ATM strategy to manage the exit, you can use the AtmStrategyChangeStopTarget() for example to change your orders on custom conditions in your code. Please see this link here - http://www.ninjatrader-support.com/H...topTarget.html
For a complete ATM strategy example, please open the 'SampleAtmStrategy' in your NinjaScript editor.
Comment
-
mktrend,
If you do not wish to wait for market data as your event you can create your own custom event. Please see this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=5965Josh P.NinjaTrader Customer Service
Comment
-
Thanks, that's what I was looking for...Originally posted by NinjaTrader_Josh View Postmktrend,
If you do not wish to wait for market data as your event you can create your own custom event. Please see this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=5965
Comment
-
Josh,Originally posted by NinjaTrader_Josh View Postmktrend,
If you do not wish to wait for market data as your event you can create your own custom event. Please see this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=5965
Why is it necessary to run the following code on every tick? When just Running it once should suffice to make it a subscriber to the event?
}Code:/// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { if (CurrentBar == 0) { // Initiate our Timer object with an interval of 1000ms (1 second) myTimer.Tick += new EventHandler(TimerEventProcessor); myTimer.Interval = 1000; myTimer.Start(); }
Comment
-
Great, thanks. The currentBar==0 makes it clear while The remarks confused me.Originally posted by NinjaTrader_Josh View PostIt is not running on every tick. It is processed once when CurrentBar == 0.
/// Called on each bar update event (incoming tick)
1- Just out of curiosity to help me with my future programming, does the:
"if (CurrentBar == 0)" run on every tick though?
2- Also, I'm trying to create an event that will trigger when the state of certain memory changes say from 0 to 1! No support but just a yes or no will do, do you see it feasible and doable utilizing the TriggerCustomEvent?
Comment
-
1. OnBarUpdate() is updated on every single tick provided you have CalculateOnBarClose = false. The comment is for that segment. Inside there we have CurrentBar == 0. This is checked every single time OnBarUpdate() is processed. There is nowhere else to put said logic. Initialize() should never contain any logic.
2. In terms of memory change, that is completely outside the scope of what we can offer support for. Unfortunately I cannot advise you on this at all. It may be best to direct your research at MSDN since that would be C# not NinjaScript.Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
607 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
353 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
561 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment