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

troubles with market orders

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

    troubles with market orders

    Dear friends.
    I have troubles with placeing market orders with my strategies.
    I have test on my PC and on my Notebook.
    I can't find even orders from my strategy.
    I have try sell and buy market orders. And got nothing.
    I have wrote simple strategy
    Code:
            protected override void OnBarUpdate()
            {
                EnterLong(1,"buy");
                EnterLong();
                Print("EnterLong");
            }
    But it works only on strategy tester. I have reset simulator few times. And reload terminal, but got nothing.

    #2
    Hello daglas,
    You have placed 2 long orders. Depending on your Entry handling/Entries per direction, one order may get cancelled.

    Since there are no condition filters and no exit/sell orders, the order(s) will be placed on the first bar of session (provided you have Exit on close set to true) and your strategy will remain in yellow state.

    Yellow highlighted "Strategy" cell indicates the strategy is waiting until it reaches a flat position to be in sync with the account position before fully starting. (Please see the options Strategies Tab section for configuration options)
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      How can I create a simple strategy which will open short / long position, at each new bar?
      For example, I want to open long order at each new bar, because I know that price will rising. What should I do?
      I will close position manually,when I decide that profit size is enough for me.

      Comment


        #4
        Hello daglas,
        Unfortunately we cannot create this strategy code for you. We can however assist with specific questions you may have or issues you run into coding this yourself.

        Specifically for your question you would use EnterLong() for example inside of OnBarUpdate(). A sample of NinjaScript programming can be found here: http://www.ninjatrader.com/support/h..._cross_ove.htm

        You would replace the crossover logic here for what you want to happen. If you want it on each new bar just removing the crossover check will be fine.

        I would also have a if(Historical) return; to the code so that it only runs when you enable it live.



        To develop your custom indicator/strategies you can contact any of our independent NinjaScript consultants as well to do this code for you. You can get the list of our NinjaScript consultants from here http://www.ninjatrader.com/partners#...pt-Consultants
        Last edited by NinjaTrader_Brett; 07-11-2012, 07:55 AM.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by kaywai, 09-01-2023, 08:44 PM
        5 responses
        602 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by xiinteractive, 04-09-2024, 08:08 AM
        6 responses
        22 views
        0 likes
        Last Post xiinteractive  
        Started by Pattontje, Yesterday, 02:10 PM
        2 responses
        20 views
        0 likes
        Last Post Pattontje  
        Started by flybuzz, 04-21-2024, 04:07 PM
        17 responses
        230 views
        0 likes
        Last Post TradingLoss  
        Started by agclub, 04-21-2024, 08:57 PM
        3 responses
        17 views
        0 likes
        Last Post TradingLoss  
        Working...
        X