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 > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 06-27-2007, 12:39 AM   #1
gert74
Member
 
Join Date: May 2007
Posts: 35
Thanks: 0
Thanked 0 times in 0 posts
Default Order functions

Is it possible that you could post the recommended code pattern for the following:

As a specific event occurs (for example the closing price of a bar crosses a certain price point) I want to enter a position (say 10 long). The strategy is not to do anything until that position has been reached. How do I ensure that the target position is reached no matter what?

Running a test on a 1 tick chart on FDAX 09-07 I had some weird things happen. If I only call EnterLong() on the initial bar I sometimes got my order cancelled partially filled. If I resubmit until the target position is reached I sometimes got errors or overfill depending on if I called the function again with the target quantity or the target quantity minus the current MarketPosition.Quantity.

The problems seemed to happen at random, but were much less frequent on slower moving markets.

I am sure I must be doing something wrong, but I am just not sure what. Therefore my question.
gert74 is offline  
Reply With Quote
Old 06-27-2007, 01:20 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Sorry, due to bandwidth reasons we are unable to provide support at that level. You might consider contacting a NinjaTrader consultant: http://www.ninjatrader.com/webnew/pa...injaScript.htm
NinjaTrader_Dierk 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
Esignal NT dll integration re: dll.call functions New2This Automated Trading 24 06-21-2007 08:06 AM
Email functions don't apear to work zoltran Strategy Development 5 03-23-2007 02:38 AM
using DLL interface functions in c# Futures_Shark Automated Trading 4 01-03-2007 02:17 AM
Looking for TradeStation System that successfully uses NT .dll functions JR Automated Trading 0 12-21-2006 03:49 AM
Is it possible to call ATI functions from NinjaScript? BCA Strategy Development 3 04-17-2006 05:36 AM


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