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

Language, names of orders change by language

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

    Language, names of orders change by language

    Hi,
    I'm developing an strategy and in OnOrderUpdate event I ask for the name of the order to take some actions. But in one PC giveme error and I put Prints to see what is happening.
    Printing order name.
    In english,
    - Close position
    - Buy to cover
    - Sell
    In Spanish
    - Cerrar posición
    - ...
    - Vender
    And interesting thing, the state of orders are in english even for spanish language like Filled, Accepted, Working...

    Why is that? I need to ask for order name, but I don't think to put all languages because have clients with diferent languages installed. I have NT 8.
    Thank you.

    #2
    Hello ervin,

    Thanks for your post.

    You specify the SignalName (such as "LongEntry") for an order in your script when calling your Entry/Exit order methods and then in OnOrderUpdate() check if the order.Name == "LongEntry" in your script for example.

    EnterLong("LongEntry");
    ExitLong("LongExit", "LongEntry");


    EnterLong(): https://ninjatrader.com/support/help.../enterlong.htm
    ExitLong(): https://ninjatrader.com/support/help...8/exitlong.htm

    The SignalName will print to the Output window in English when printing order.Name in OnOrderUpdate() regardless of what language the platform is set to use.

    The orderState is an enum and this will also print to the Output window in English when printing orderState in OnOrderUpdate(). So you could check if order.OrderState == OrderState.Filled in OnOrderUpdate(), for example.

    See the 'Order Entry Methods' section of the help guide page linked below for more information about using SignalNames for Entry/Exit orders. See the 'How to close a position' section of the help guide page below as well for information about FromEntrySignal which is used for Exit orders.

    Managed Approach: https://ninjatrader.com/support/help...d_approach.htm
    Last edited by NinjaTrader_BrandonH; 08-24-2023, 03:02 PM.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your ansqer Brandon.
      I use names on my entries and I controll it on OnOrderUpdate like you said. But I have a condition in OnBarUpdate when if Position is Long I code EnterShort. So, NT closes the long s and open the short with the name that I give to it.
      But when NT close the position, NT put the name in english "Close position" in Spanish "Cerrar posición". Y lo mismo pasa en los casos Buy to Cover, Sell, Exit on Session, in spanish changes the name.
      Like the image I attach.
      In OnOrderUpdate I look for the name but I realize that the NT put in spanish.

      Click image for larger version

Name:	imagen.png
Views:	77
Size:	12.9 KB
ID:	1266077

      Comment


        #4
        Hello ervin,

        This is expected that users in other countries are able to read the order names and types.

        If this is an issue, it may necessary to switch to using the unmanaged approach so that you can completely control the order signal names.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you,
          I want to use managed approach, but what do you sugest? how can I ask for a name of one order if the name changes in each language? I mentioned some examples, Close position, Close on en session, buy to cover, etc.

          Comment


            #6
            Hello ervin,

            Thanks for your notes.

            If NinjaTrader 8 is set to a language other than English and you call an Entry order in the opposite direction while using the Managed Approach method for handling orders, the name of the order will be in the Language that the platform is set to.

            As my colleague Chelsea stated, "If this is an issue, it may necessary to switch to using the unmanaged approach so that you can completely control the order signal names."

            See this help guide page for more information about coding a strategy using the Unmanaged Approach for placing and managing orders in a NinjaScript strategy: https://ninjatrader.com/support/help...d_approach.htm
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by burtoninlondon, Today, 12:38 AM
            0 responses
            2 views
            0 likes
            Last Post burtoninlondon  
            Started by AaronKoRn, Yesterday, 09:49 PM
            0 responses
            11 views
            0 likes
            Last Post AaronKoRn  
            Started by carnitron, Yesterday, 08:42 PM
            0 responses
            10 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Yesterday, 07:51 PM
            0 responses
            12 views
            0 likes
            Last Post strategist007  
            Started by StockTrader88, 03-06-2021, 08:58 AM
            44 responses
            3,982 views
            3 likes
            Last Post jhudas88  
            Working...
            X