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 fx.practic, 10-15-2013, 12:53 AM
|
5 responses
5,403 views
0 likes
|
Last Post
by Bidder
Today, 12:22 AM
|
||
Started by Shai Samuel, 07-02-2022, 02:46 PM
|
4 responses
94 views
0 likes
|
Last Post
by Bidder
Today, 12:11 AM
|
||
Started by DJ888, Yesterday, 10:57 PM
|
0 responses
6 views
0 likes
|
Last Post
by DJ888
Yesterday, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
158 views
0 likes
|
Last Post Yesterday, 10:23 PM | ||
Started by Belfortbucks, Yesterday, 09:29 PM
|
0 responses
8 views
0 likes
|
Last Post
by Belfortbucks
Yesterday, 09:29 PM
|
Comment