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!
See more
See less

Partner 728x90

Collapse

SubmitOrderUnmanaged -------OrderType.MIT not working

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

    SubmitOrderUnmanaged -------OrderType.MIT not working

    OrderType.MIT not working for me.
    i expect that when the condition = true ---> send the MIT order at High[0] or Low[0]

    but the thing is once i send the MIT order, the order will just filled right at the next sec.


    in the picture attached, the condition isLong=True. the MIT order shoud be right at the pp(the golden line)
    but it just fill at next order.



    I am not sure what is wrong here

    -----------------------------------------------------------------------------------------------------------------------------


    if (isLong)
    {
    _entryOrder = SubmitOrderUnmanaged(0, OrderAction.Buy, OrderType.MIT, posSize,0,
    High[0]+(RSI_Tick*0.25),"", EnterLongName);

    }
    if (!isLong)
    {
    _entryOrder = SubmitOrderUnmanaged(0, OrderAction.SellShort, OrderType.MIT, posSize, 0,
    Low[0]-(RSI_Tick*0.25),"", EnterShortName);

    }
    ----------------------------------------------------------------------------------------------------------------------

    #2
    Hello code77995,

    Thanks for your post.

    To understand why the script is behaving as it is, such as placing orders or not placing orders when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

    In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

    Below is a link to a forum post that demonstrates how to use prints to understand behavior.
    https://ninjatrader.com/support/foru...121#post791121

    See the attached example script that demonstrates submitting a Buy MIT order and a Sell MIT order using the Unmanaged Approach. Once the MIT orders are submitted, they will fill once the market price touched the price of the MIT orders.

    Let us know if we may assist further.
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by pibrew, Today, 06:37 AM
    0 responses
    4 views
    0 likes
    Last Post pibrew
    by pibrew
     
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    11 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    16 views
    0 likes
    Last Post AaronKoRn  
    Working...
    X