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:	136
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:	117
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 NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          54 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          130 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          72 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          44 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X