Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

building a system always in the market

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

    building a system always in the market

    Hallo,

    I am trying to build a continuos system, always in the market, with the following code:

    if (a == true)
    {
    EnterLongStop(DefaultQuantity, MyHigh, "");
    }
    if (b == true)
    {
    EnterShortStop(DefaultQuantity, MyLow, "");
    }

    However, it does not always reverse, sometimes it just closes the long position without going short (or viceversa) but sometimes it does it alright. I have read the Order Handling Rules and I understand NT sometimes ignore StopOrders but I do not see why.

    Any comments?

    Thanks!

    #2
    Have you tried using TraceOrders to determine the behavior of your orders? If an order is ignored you will be given a reason from the output.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Well, The output says: Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'

      I do not understand the EnterStop orders. I thought if I were long, and the lines crossed, an order EnterShortStop will short the thing but sometimes it does, sometimes it doesn´t (Have a look at the picture).
      Attached Files

      Comment


        #4
        Are you reading the right line of output? You will only get that message if you are already long and submitted another long entry order. Stop orders are essentially market orders once the stop price is hit. That is the behavior they undertake. You will need to debug what you are experiencing. Use print functions that display information about Position.MarketPosition to try and figure out what is happening in your strategy.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X