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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      476 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      317 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      254 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      340 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      306 views
      0 likes
      Last Post CarlTrading  
      Working...
      X