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 10-15-2008, 11:57 AM   #1
ninjakevin
Junior Member
 
Join Date: Oct 2008
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Question Rebalance via CSV

Hello,

I'm wanting to develop an automated order execution system that does this:

1) launch application/script from scheduled task
2) reads a CSV file to determine a desired position (e.g. /ESZ8, -100)
3) connects to brokerX and takes current inventory (e.g. /ESZ8, 0)
4) places a market order to make inventory sync with CSV (sell short 100 /ESZ8 @ market)
5) close application

Is Ninja a good choice for this application? Can anybody point me in the right direction?

Thanks.
ninjakevin is offline  
Reply With Quote
Old 10-15-2008, 12:25 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Hi ninjakevin,

Unfortunately that some of those steps are not available for automation through NinjaScript. NinjaScript is C# so it is very powerful, but for the advanced programming aspects of C#, we just cannot support them on the forums.
NinjaTrader_Josh is offline  
Reply With Quote
Old 10-15-2008, 12:47 PM   #3
ninjakevin
Junior Member
 
Join Date: Oct 2008
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default

Which steps are supported? I'm well versed in c# and not afraid of extending the platform. I'm trying to understand what Ninjatrader can and can't do. Thanks
ninjakevin is offline  
Reply With Quote
Old 10-15-2008, 12:55 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

All except step 4 are outside the scope of NinjaScript. NinjaScript can place orders for you, but not any of the other stuff without some more advanced programming. Retrieval of inventory is not doable in NinjaTrader right now either.
NinjaTrader_Josh is offline  
Reply With Quote
Old 10-16-2008, 12:05 AM   #5
auspiv
Member
 
Join Date: Jul 2007
Location: steamboat, co
Posts: 52
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Retrieval of inventory is not doable in NinjaTrader right now either.
wouldn't that just be:

int MarketPosition(string instrument, string account)
-Gets the market position for an instrument/account combination. Returns 0 for flat, negative value for short positive value for long.
auspiv is offline  
Reply With Quote
Old 10-16-2008, 08:40 AM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Those functions are not NinjaScript functions. They are for the DLL and COM interfaces. You will be programming outside of NinjaTrader for what you want anyways so it may work for you.
NinjaTrader_Josh is offline  
Reply With Quote
Old 10-16-2008, 10:08 AM   #7
auspiv
Member
 
Join Date: Jul 2007
Location: steamboat, co
Posts: 52
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Those functions are not NinjaScript functions. They are for the DLL and COM interfaces. You will be programming outside of NinjaTrader for what you want anyways so it may work for you.
well for ninjascript functions wouldn't it just be marketposition and quantity?
like
Code:
Print(Position.MarketPosition.ToString() + " " + Position.Quantity.ToString());
auspiv is offline  
Reply With Quote
Old 10-16-2008, 10:13 AM   #8
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

That gets you the position direction and its quantity based off of the strategy and not your account.
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


All times are GMT -6. The time now is 05:58 AM.