Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
enter a trade 5 seconds before the 5 minute candle closes.
Collapse
X
-
enter a trade 5 seconds before the 5 minute candle closes.
how can I in Strategy wizard tell Ninjatrader once the conditions are met that it should enter long (or Short) 5 seconds before the 5 minute candles closes. is there a code i can just paste inside to make this happen.Tags: None
-
Hi wallsteetking,
This is unfortunately not available with the strategy wizard only. You will need to work in code and can take advantage of C# built in date / time classes. The following link can help generally work with these:
To do this would require comparisons using bar's time stamp with Time[0], and your computer clock with DateTime.Now.Ryan M.NinjaTrader Customer Service
-
Hello Ryan thank you for helping me with this problem. I dont think I am doing this correctly can you take a look at it.
I looked at the examples none of them use comparisons can you help me with this.Code:if (Time[0].Date == DateTime.4,53,0) { EnterLong(DefaultQuantity, ""); }
Comment
-
Hello wallstreetking,
Thanks for writing in and I am replying for Ryan.
Please try the below code to enter in a position 5 seconds before a bar closes.
The above code will work in realtime only.Code:if (DateTime.Now >= Time[0].AddSeconds(-5)) { //do something. }
Please let me know if I can assist you any further.JoydeepNinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
253 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
164 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
169 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
251 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
203 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment