Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Starting a strategy in middle of session
Collapse
X
-
Ok i am thick headed of course and im shure it would solve issues for allot fo people with screen shots, BUt what is a "bracket" I would like to do this and have no cluse what you are talking about.
Thanks
Tim
Basically this is what i see
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
where do i put what is stated here??
after OnBarUpdate () or before or below above?? and wheres the brackets
Last edited by timmyb; 03-13-2008, 02:16 PM.
Comment
-
By bracket I mean these characters: { }
You should see this on your end:
Code:[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] OnBarUpdate() { // blahbalhala; }[/SIZE][/FONT][/SIZE][/FONT]
You want to place the code snippet at the beginning of the OnBarUpdate() method which means INSIDE the { }s.
Code:[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] OnBarUpdate() { if (Historical) return; // blahbalhala; }[/SIZE][/FONT][/SIZE][/FONT]
Josh P.NinjaTrader Customer Service
Comment
-
Originally posted by timmyb View Postthanks josh, i figured it out, but i am sure that post will helps many a newb find their footing.
If i set the option to
"Wait until flat before executing live"
it will essentially help the LIVE account positions get in sync (position wise) with the Strategy postions?
Is that right?
If it is right then I have a suggestion. Please update the thread
http://www.ninjatrader-support2.com/...ead.php?t=4033 to include this as a method to sync the account.
The current method to put the accounts in sync is a lil scary .. as it is suggesting the user to put a live order to make the accounts in sync.... the trade might already have played out and still the user is forced to submit the trade just to make the account sync... I wont do it and i am sure many wont...
Please also include this as part of documentation where this is discussed. :-)
it will be great to have the
If (historical)
return;
solution also listed there.. I know it will be useful cus it took me a while to stumble upon this thread to find the solution.
Thanks
Rishi
Comment
-
"Wait until flat" does not help you actively sync. It is just an alternative if you know for a fact that you have a flat account position. It will not help you in anyway if your account position is not flat. The article was designed for people with active account positions and differing strategy positions.
if (Historical) return; is in the Help Guide.Josh P.NinjaTrader Customer Service
Comment
-
Hello dtf139,
Nothing has changed in NT7 in regards to synchronizing your Strategy Position vs your Account Position which is what I believe you were inquiring about.
A good video that goes over all the different options can be found on our YouTube page at the following link.
Download NinjaTrader FREE at http://www.ninjatrader.comThis video demonstrates the differences between Strategy positions and Account positions and how to sy...
If you have a suggestion on how this can be made easier I can forward it to our Development team, but how it is setup currently is to have the most flexibility.
Happy to be of further assistance.JCNinjaTrader Customer Service
Comment
-
I'm not a programmer and so everything I do is through the strategy wizard.
I have been mostly using NJT for intraday trading but I am now testing daily bars and longer hold times.
My problem right now is that if for some reason my daily strategy does not get started before the start of the session then NJT will not enter any trades if the strategy position is long already. I simply want a way to force NJT to enter a live position regardless of what the "strategy position" is. I know from the previous conversations that you can do that using if(historical) but that requires editing the strategy manually but after that the strategy cant be tweaked or changed through the wizard.Last edited by dtf139; 07-25-2013, 04:09 PM.
Comment
-
Hello dtf139,
In the video that I linked it goes over how to setup your strategy to have NinjaTrader submit an order for you automatically if your Strategy is in a position when you start it up.
If you go to Tools -> Options -> Strategies tab -> NinjaScript tab you may set NinjaTrader to "Immediately submit live working historical orders". This basically means that even if your Strategy is in a position historically if a trigger to submit an order is hit NinjaTrader will send the order regardless of your Account Position.
Now if you want to make sure that your Strategy Position and your Account Position match you will want to Sync them. So basically if your Strategy is in a position NinjaTrader will submit orders to match your Account with you Strategy. To enable "Sync account Position" go to your Strategy parameters and set it to true.
This will require no custom programming.
Let us know if you have any questions.JCNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by love2code2trade, Today, 01:45 PM
|
1 response
8 views
0 likes
|
Last Post Today, 02:10 PM | ||
Started by Gibranes, Today, 10:05 AM
|
5 responses
21 views
0 likes
|
Last Post Today, 01:55 PM | ||
Started by 09try, 03-29-2024, 01:27 PM
|
9 responses
83 views
0 likes
|
Last Post
by ntcat
Today, 01:16 PM
|
||
Started by ninza33, Today, 06:28 AM
|
4 responses
17 views
0 likes
|
Last Post
by ninza33
Today, 12:38 PM
|
||
Started by ScottWalsh, Yesterday, 04:29 PM
|
4 responses
18 views
0 likes
|
Last Post Today, 12:00 PM |
Comment