Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Incorrect placement of orders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Incorrect placement of orders

    Click image for larger version  Name:	errorjpg.JPG Views:	0 Size:	104.7 KB ID:	1196307Hi,

    I am struggling to find the error in my code. The BuyLong condition is satisfied on bar 36 but for some reason the markers are inaccurate(showing buy at bar 27). The buy price is correct however. Any ideas why this could be happening?


    if(barmove<=IntInput1 && barmove>=IntInput2)
    {
    int cur=newbar.curbar; (This shows as 36 in my class)
    int checkbar=CurrentBar; (Current bar shows 36)
    double checkclose=Closes[1][0]; (Close price is 4620.75)
    EnterLong(BarsInProgress,Convert.ToInt32(DefaultQu antity), "");
    }

    But somehow ,the position of the marker is off and shows buy at bar 27 @ closing price of 4621.50. The text position is inaccurate as well showing buy @4260.75. lease see attached image above.

    I'd appreciate your input. Thanks


    P.S- I just figured it out. It has to do with the ticks skipping a few price levels . Every tick does not move in 0.25 increments. It can jump from 0.25- 1.25 which was causing the issue. Thanks anyway
    Last edited by MyFirstMillion; 04-02-2022, 04:25 PM.

    #2
    Hello MyFirstMillion,

    To understand why the order is being submitted when it is being submitted, print the values from the conditions and enable TraceOrders.

    Below is a link to a forum post that demonstrates using Print() and TraceOrders to understand behavior.


    You may be looking at rapid movement and ticks that are all being received at the same second.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    53 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X