NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > ATM Strategies (Discretionary Trading)

ATM Strategies (Discretionary Trading) Support for Advanced Trade Management, AutoTrail, AutoBreakeven, Stop Strategy and Simulated Stops etc...

Reply
 
Thread Tools Display Modes
Old 01-07-2009, 11:35 AM   #1
snaphook
Senior Member
 
Join Date: Apr 2008
Posts: 376
Thanks: 0
Thanked 20 times in 11 posts
Default Manual ATM Strategy vs. NinjaScript ATM Calls

I have created an AutoTrade Script file based on your example. It requires that Order IDs and ATMStrategy IDs be 0 length before an order is entered. It seems, however, that if I manually enter a trade to an ATM Strategy, the two IDs are always returned as 32 and 38 char lengths and do not zero out when closed and the position goes flat. Stopping the running Script and re-attaching the Script strategy zeros the two IDs.

If the script places the order, the IDs reset to 0 length.

Is there something else I should know or review.

This

Print(Time[0] + ", " + Instrument.FullName + ", " + orderId.Length + ", " + atmStrategyId.Length + ...

returns

1/7/2009 12:29:17 PM, TF 03-09, 32, 38 ...

even when the position is flat
snaphook is offline  
Reply With Quote
Old 01-07-2009, 11:40 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

snaphook,

NinjaScript strategies should only be used with ATM strategies it invokes itself. It is not intended to interface with things you have done manually for an entry.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-07-2009, 12:30 PM   #3
snaphook
Senior Member
 
Join Date: Apr 2008
Posts: 376
Thanks: 0
Thanked 20 times in 11 posts
Default

I'll play around with it to see what happens when human intervention occurs.

If I have a script strategy ("abc") attached to TF 03-09 and I manually enter a trade on a different signal, or on a whim whichever fits; if I left click the close button on the price ladder, the position is closed but the chart script strategy is stopped on the chart and I must reattach it. If I middle click the Close button, the position is closed, but the chart script remains attached. Is this the way it is supposed to work?

Also, if the script triggers and calls an ATM Strategy and I manually cancel it, will the Order and ATMStrategy IDs be cleared or will the script kinda lose its place and the IDs never reset to 0 length?

I'm trying to get a handle on what can and can not be done when running from a chart based Ninja Strategy.

Thanks,
Snap
snaphook is offline  
Reply With Quote
Old 01-07-2009, 12:36 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Snap,

Yes, that is how it works. The close button closes ALL positions, automated or manual, unless you middle mouse click it.

If the script triggers an ATM strategy you should be able to monitor it and reset it to 0 yourself when such a condition occurs.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-07-2009, 01:35 PM   #5
snaphook
Senior Member
 
Join Date: Apr 2008
Posts: 376
Thanks: 0
Thanked 20 times in 11 posts
Default

OK. The Close button tool tip is very misleading.

"Closes a position (left click) or strategy (middle click)"

but in fact, left click closes all positions and all strategies and middle click just closes the current strategy position.
snaphook is offline  
Reply With Quote
Old 01-07-2009, 01:44 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Right. That is correct. Left click closes the position, middle click closes the selected strategy. http://www.ninjatrader-support.com/H...nButtons3.html
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-07-2009, 02:25 PM   #7
snaphook
Senior Member
 
Join Date: Apr 2008
Posts: 376
Thanks: 0
Thanked 20 times in 11 posts
Default

When I have tried it, a left click, in addition to closing the current ATMStrategy position and canceling any working orders, also stops any working script strategies attached to the instrument chart. This means that, to close an ATMStrategy position called from script, a left click on Close will close your position andyour working script strategy forcing you to reload it, whereas a middle click will close your position in the working ATMStrategy but leave your working script strategy alone.
snaphook is offline  
Reply With Quote
Old 01-07-2009, 02:28 PM   #8
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

That is correct. That is the behavior you should see.
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling an ATM Strategy Within NinjaScript Jim-Boulder Strategy Development 5 08-26-2010 02:54 AM
Initiating ATM Strategies in a NinjaScript daven Automated Trading 7 08-18-2010 10:47 PM
Combining ATM and NinjaScript cicondo ATM Strategies (Discretionary Trading) 16 02-19-2009 07:43 AM
Creating ATM Strategy Template with NinjaScript rsr91602 ATM Strategies (Discretionary Trading) 1 11-11-2008 09:10 AM
ATM strategy with NinjaScript John833 Strategy Development 2 08-24-2008 12:31 PM


All times are GMT -6. The time now is 09:07 PM.