protected override void Initialize() { // Triggers the exit on close function 30 seconds prior to session end [COLOR=#ffffff]ExitOnClose[/COLOR] = true; ExitOnCloseSeconds = 30; }
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Overriding the strategy parameters (using values hardcoded)
Collapse
X
-
Overriding the strategy parameters (using values hardcoded)
I see for the help on ExitOnClose that one can specify this in the initialize method:
Code:Tags: None
-
Whatever value you set for ExitOnClose you in Initialize() would make it to the strategy properties dialog and thus would be effective if you didn't change it.
What probably confuses you is the fact, that the strategies property dialog maintains the last set of values. Unfortunately there is no way around.
-
Originally posted by NinjaTrader_Dierk View PostWhatever value you set for ExitOnClose you in Initialize() would make it to the strategy properties dialog and thus would be effective if you didn't change it.
What probably confuses you is the fact, that the strategies property dialog maintains the last set of values. Unfortunately there is no way around.
Thanks
Comment
-
Exit Not On Close If strategy made profit
Hello
Is there a way within a strategy to change the ExitOnClose Flag
depending on if the strategy made profit today, or would you recommend exiting all positions by a specific time and not use the Exit On Close = true at all in strategies?
Regards
tradereight
Comment
-
Hello,
It may work but I recommend changing the code to exit at a certain time. Give it a try using a condition something like this:
if(ToTime(Time[0]) >= 93000)
{
ExitLong(....);
}
This link may help:
http://www.ninjatrader-support2.com/...ead.php?t=3226
DenNinjaTrader Customer Service
Comment
-
So you're recommending leaving the session begin/end time at midnight and using a filter on the trading hours? This is a good idea because my strategy is multi-instrument and different instruments have different trading hours. The only problem I see is indicators would be calculated based on non-trading hours data, which I don't think is what I want.
Originally posted by NinjaTrader_Ben View PostHello,
It may work but I recommend changing the code to exit at a certain time. Give it a try using a condition something like this:
if(ToTime(Time[0]) >= 93000)
{
ExitLong(....);
}
This link may help:
http://www.ninjatrader-support2.com/...ead.php?t=3226
Comment
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
2 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 |
Comment