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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 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