NinjaTrader Support Forum  

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 07-22-2009, 08:58 AM   #1
NetTecture
Senior Member
 
Join Date: Mar 2009
Posts: 172
Thanks: 0
Thanked 1 time in 1 post
Default Problem cancelling orders - positions add up?

Hello,

anyone a tip for that?

I have a strategy loosing tons of money on the YM at the moment (which is ok - it is absolutely not finished, I am right now working on filtering and logic).

Anyhow, it works "good" on the YM.

Now, I did put it onto the TF. On the TF I Have the problem that the positions get "out of what".

The strategy opens three lots, under 3 signals. THis works perfect on the YM - it gets stopped out etc.

Now, on the TF, I regularly end up with 5-6 open lots on the simulator. Basically, it seems my code triggers multiple closes, which results in reversed positions.

I can see that, because i see "CLose Position" for 3 cars, and then "Buy to Cover". Same price, same amount. The result is a reverse in positions - on which sometimes then my "normal reverse" (reverse signal) is added.

Example:

* Sell 3 cars normaly, one for each signal.
* Some bars later, I get a reversal. I get:
- Buy to Cover
- CLose Position
- 3 signal adds.

Naturally - it should not buy to cover AND close the position.

Any idea what may happen here?
NetTecture is offline  
Reply With Quote
Old 07-22-2009, 09:06 AM   #2
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 90 times in 82 posts
Default

NetTecture, have you tried using TraceOrders to get an idea of what your strategy is "thinking"? TraceOrders will tell you most everything you need to know about the strategy's orders. Here is a link to a great post by Josh that explains how to use TraceOrders.
NinjaTrader_Austin is offline  
Reply With Quote
Old 07-23-2009, 12:55 AM   #3
NetTecture
Senior Member
 
Join Date: Mar 2009
Posts: 172
Thanks: 0
Thanked 1 time in 1 post
Default

TraceOrders is in now. Lets see what happens.

Funny enough, that was rare in most circumstances on my main market (YM), while it happened pretty regular in the other market. I will see what it was
NetTecture 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
Orders not cancelling... BigDog008 Strategy Development 14 06-15-2009 12:42 PM
Cancelling active orders. Scooter1 Miscellaneous Support 2 10-22-2008 06:10 AM
Cancelling all Orders PolePosition General Programming 7 05-22-2008 03:31 AM
Cancelling orders NinjaTrader_Ray Strategy Development 0 03-29-2007 02:01 AM
Cancelling orders with SuperDom dragon99999 Miscellaneous Support 4 05-15-2005 11:33 PM


All times are GMT -6. The time now is 01:04 AM.