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
Strategy Start Time Greater than End Time
Collapse
X
-
Hello Kubera2024 and EC_Chris,
I have included an export for my demonstration video yesterday. This can be tested in the Strategy Analyzer and the prints that show if the filter "trade" becomes true or false can be observed in the NinjaScript Output window.
For the thread's reference, additional examples on time checks can be seen in the sample here: https://ninjatrader.com/support/foru...ead.php?t=3226
Please let us know if we can be of further assistance.
-
Same issue, I just reset strategy on start of each interval. Like time 1 to 160000 or 170000 to 240000
Leave a comment:
-
Hello EC_Chris,
Thanks for opening the thread.
I suggest to add debug prints to your code so you can see if this trade bool is getting set appropriately, or if there is another part of the logic that is preventing your orders from submitting.
I have created a demonstration showing how debugging prints can be used with the Strategy Analyzer to analyze the strategy logic.
Demo: https://www.screencast.com/t/nDBZkW9s
Additional tips on debugging can be found here: https://ninjatrader.com/support/foru...ead.php?t=3418
Please let me know if you have any additional questions.
Leave a comment:
-
Strategy Start Time Greater than End Time
I have an issue with strategy start and end time
Based on this thread
I am using this code
Code:if(StartTime<StopTime && ToTime(Time[0]) >= (StartTime * 100) && ToTime(Time[0]) <= (StopTime * 100)) trade=true; else if (StartTime>StopTime) { if ((ToTime(Time[0]) >= (StartTime*100) && ToTime(Time[0]) <= 235959) || ToTime(Time[0]) < (StopTime * 100)) trade=true; } else trade=false;
Code:StartTime = 1500; StopTime = 1230;
So the strategy crosses over sessions.
It seemed like it worked, but it is not working anymore. This has been a real headache, is there a simpler way to code this?Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bmartz, Today, 09:30 AM
|
2 responses
11 views
0 likes
|
Last Post
by bltdavid
Today, 11:24 AM
|
||
Started by f.saeidi, Today, 11:02 AM
|
1 response
3 views
0 likes
|
Last Post Today, 11:08 AM | ||
Started by geotrades1, Today, 10:02 AM
|
4 responses
12 views
0 likes
|
Last Post
by geotrades1
Today, 11:08 AM
|
||
Started by rajendrasubedi2023, Today, 09:50 AM
|
3 responses
16 views
0 likes
|
Last Post Today, 10:57 AM | ||
Started by lorem, Today, 09:18 AM
|
2 responses
11 views
0 likes
|
Last Post Today, 10:55 AM |
Leave a comment: