Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

limit orders

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

    limit orders

    Hi

    I am new in ninja script programming though have very wide experience in VB and C

    My problem is that I am trying to place a simple limit order but it is not taking the command. I mean the code is executed but there is no result. When I try to place a market order, I am successfull but not with limit order
    I will appreciate help on this, please

    Thanks

    #2
    You could try using the TraceOrders option: http://www.ninjatrader-support.com/v...ead.php?t=3627

    Comment


      #3
      Limit order not working

      Hi

      Thanks for your reply. I have already used the trace option. It shows in the output window that it has placed the order but I dont see the order on the chart or in the control center

      Comment


        #4
        Limit order not working

        HiIS there any working strategy available that I can execute and see Below is a simple code that enters long at 1413 which is fine.however, the code does not place long and short limits. i have gone through all the help, but somehow it doesnt seem to work.--------- CODE -------------#region Using declarationsusing System;using System.ComponentModel;using System.Diagnostics;using System.Drawing;using System.Drawing.Drawing2D;using System.Xml.Serialization;using NinjaTrader.Cbi;using NinjaTrader.Data;using NinjaTrader.Indicator;using NinjaTrader.Gui.Chart;using NinjaTrader.Strategy;#endregion// This namespace holds all strategies and is required. Do not change it.namespace NinjaTrader.Strategy{ [Description("Testing of various codes")] public class Test : Strategy { bool varLonged = false; private IOrder entryOrder = null; private IOrder limitOrder = null; private IOrder exitOrder = null; protected override void Initialize() { CalculateOnBarClose = false; TraceOrders = true; EntriesPerDirection = 4; EntryHandling = EntryHandling.AllEntries; ClearOutputWindow(); } protected override void OnBarUpdate() { if (varLonged == false) { entryOrder = EnterLong(8,1413,"order1"); limitOrder = EnterLongLimit(8,1412.5,"order2"); exitOrder = EnterShortLimit(16,1413.5,"order3"); varLonged = true; } } } }

        Comment


          #5
          I suggest placing Print() statements before order command. Then there surely will be an equivalent line in the output window (TraceOrders=true) which will tell you what happened to the order.

          Also: Please make sure you remove the order placement for the market order and you understand how EntriesPerDirection works. http://www.ninjatrader-support.com/H...Direction.html

          Comment


            #6
            HI Dierk

            Thanks again. I have also placed print() command too and it shows that the code is executed that is the reason that trace order also says that placing the order

            But the problem is that I dont see the limit orders on the chart or in the control center

            Comment


              #7
              Please proceed as per my last post.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              648 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              369 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              573 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              575 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X