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 NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X