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 cmoran13, Yesterday, 01:02 PM
        0 responses
        31 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        22 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        162 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        95 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        151 views
        2 likes
        Last Post CaptainJack  
        Working...
        X