Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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.
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.
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 rocketman7, Today, 09:41 AM
|
4 responses
15 views
0 likes
|
Last Post
by rocketman7
Today, 02:56 PM
|
||
Started by selu72, Today, 02:01 PM
|
1 response
9 views
0 likes
|
Last Post Today, 02:17 PM | ||
Started by WHICKED, Today, 02:02 PM
|
2 responses
13 views
0 likes
|
Last Post
by WHICKED
Today, 02:15 PM
|
||
Started by f.saeidi, Today, 12:14 PM
|
8 responses
21 views
0 likes
|
Last Post
by f.saeidi
Today, 01:55 PM
|
||
Started by Mikey_, 03-23-2024, 05:59 PM
|
3 responses
56 views
0 likes
|
Last Post
by Sam2515
Today, 01:47 PM
|
Comment