My program was working pretty good. However, I would add some code to make sure that the previous order is fully filled, and then submit new order. However, the program stop some where, and I believe it is because it could not get the right number for order.Filled in historical data. How should I deal with this issue?
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
When using order.Filled, the program will not work
Collapse
X
-
When using order.Filled, the program will not work
because the program could not get this information in historical data. Is this a known issue? Or I was wrong.
My program was working pretty good. However, I would add some code to make sure that the previous order is fully filled, and then submit new order. However, the program stop some where, and I believe it is because it could not get the right number for order.Filled in historical data. How should I deal with this issue?Tags: None
-
Thanks, Josh! I will debug it. However, how does Ninjatrader
deal with the code, such as "if (order.Filled == intTradedShares)" in historical data? My code does not allow any further trading if the previous order is not fully filled. So if there is no way to deal with this in historical data, my program will stuck in the first trade in historical data. That is what happened to me right now. Thanks again!
Comment
-
Thanks, Josh. I did it just like you suggeted. I checked the order is not null, and I assigned the order.Filled to an integer variable, then I compared if the integer variable equals to the shared the original order sent. My questions is that what ninjatrader deals with the order.Filled for historical data? i.e. what does order.Filled return when using historical data?
Comment
-
Thanks, Josh. I debuged it using print command. The order.Filled returns 0 for historical data. So my code will never go further because it means that my initial order has never been filled, and no more order will be submitted if the initial order is still pending. I will find a way to deal with this issue. If you can give me a simple hint to make it a easy fix, it will be great.
Comment
-
Thanks, Austin. I debugged it over the weekend. I got the order.Filled from OnOrderUpdate. It returns 0 when running through historical data. And when it is 0, it means my order will never been filled. And it stucks there forever. However, after I fixed this problem. More problems happened, and I made a new post.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Austiner87, Today, 03:42 PM
|
1 response
17 views
0 likes
|
Last Post Today, 07:38 PM | ||
Started by cshox, Today, 11:11 AM
|
2 responses
15 views
0 likes
|
Last Post
by cshox
Today, 07:21 PM
|
||
Started by algospoke, Today, 06:53 PM
|
0 responses
9 views
0 likes
|
Last Post
by algospoke
Today, 06:53 PM
|
||
Started by mlprice12, 12-21-2021, 04:55 PM
|
3 responses
297 views
0 likes
|
Last Post
by paypachaysa
Today, 06:15 PM
|
||
Started by lorem, 04-25-2024, 09:18 AM
|
20 responses
86 views
0 likes
|
Last Post
by lorem
Today, 06:07 PM
|
Comment