Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Mutltiple entries with different signal names

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

    Mutltiple entries with different signal names

    I am not finding why the following would not work:

    if (Condition)
    {
    EnterLong(Contract1, @"Long 1");
    EnterLong(Contract2, @"Long 2");
    }​

    Only the first entry is made. Why would the second entry not be made?

    #2
    I found the issue. I had added the ability to add a second contract with a separate signal name and then enabled the strategy and it would not work. I did this multiple times with no change. The issue was, apparently when I change things within the OnStateChange method, I have to remove the strategy from the chart and add it again. This corrected it.

    Comment


      #3
      Hello smcllr,

      Thanks for your post.

      That is correct. after making changes to a custom NinjaScript strategy and compiling, the strategy should be removed and readded to the Strategies tab of the Control Center or Chart window.

      This is to ensure that the changes you made in the script's code are implemented in the strategy instance that is being tested
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X