Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy does not commence when Market reaches my signal

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

    Strategy does not commence when Market reaches my signal

    Click image for larger version

Name:	Longstraddle101921 raw code.png
Views:	138
Size:	73.8 KB
ID:	1175468
    Pictured above is the raw code for my strategy.

    From lines 56 to 62 are my user input values I set as doubles to tag specific price points.

    Beginning from line 82, I tell the robot to place orders at specified price points "LongEntry" and "ShortEntry" when the current ask or bid equals my signal price set as "Benchmark1."

    After compiling and applying the strategy to my chart, the orders "LongEntry" and "ShortEntry" are not placed when the Market ask or bid equals "Benchmark1".

    How do I get the robot to automatically place orders for me, say 1 point away in both directions from signal price point ("Benchmark1")= to a user input double value? ​

    #2
    Hello Don22Trader1,

    Thank you for the post.

    From the image I can see one problem is that you are trying to go long and short, with the managed approach you can't do that. If you are trying to make a bracket entry with OCO you need to use the unmanaged approach for that. You can find a sample here: https://ninjatrader.com/support/foru...elp#post770579

    I otherwise don't see a print inside the condition so that would be a good place to start to make sure the condition is actually becoming true.

    I look forward to being of further assistance.

    Comment


      #3
      Can you explain what a "Print" is and provide an example on how I can use here?


      Click image for larger version

Name:	basic long entry.png
Views:	119
Size:	34.4 KB
ID:	1175514

      Another note: I have adjusted my strategy to one direction only, thus staying within the managed approach. After running the strategy, still my order is not placed when Market Bid or Ask equals to my Benchmark. Is this where I use the Print mechanism to have the bot place my "LongEntry" order automatically when my signal ("Benchmark") is reached?



      Comment


        #4
        Hello Don22Trader1,

        Thanks for the update.

        With the changes that sounds like it would be good to now add prints to see what specifically is happening. You can use the control center New -> NinjaScript Output window to observe prints.

        Here are some details on prints: https://ninjatrader.com/support/help...script_cod.htm

        Putting a Print inside the condition before the entry would be a good first step. If the print doesn't show up that lets you know the condition was always false. I would also suggest enabling TraceOrders when using the managed approach to see any order warnings.





        I look forward to being of further assistance.

        Comment


          #5
          Jesse,

          I have figured out why my strategy was not starting when market reached my signal. The strategy was not enabled on my control center "strategies" tab. Quite a simple fix.

          The print mechanism also helped with following my strategy as it continues to work.

          Thanks for the help.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          47 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          23 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          33 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          50 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          42 views
          0 likes
          Last Post CarlTrading  
          Working...
          X