Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IOrder

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

    #16
    Originally posted by ohjob View Post
    Hi
    Thanks for help and the syntax link was particularly helpful.The amended strategy is not performing exactly as expected however,what I am trying to achieve is as follows.When the Trix crossover occurs for the first time only Long1 enters then If another crossover occurs and Long1 has not been stopped out Long2 enters so we are now net +2.If the Trix crosses for a third time and both Long1 and Long2 are both still live Long3 enters giving us a total of 3 long positions.I have the exits working OK I just can't get the entry orders to stack correctly in order.Any help to achieve this would be greatly appreciated. Thanks
    I will again refer you to the code that I already posted: http://www.ninjatrader.com/support/f...05279#poststop

    However, I will show the use-code in blocks instead of blockless statements. So this is how you would use them then:

    Code:
     
    if(//Trix crossover)
    {
    if (entryOrder1 == null) 
    {
    entryOrder1 = EnterLong(entry1ParamList[]);
    //any other code, like drawing some marker etc., goes here
    }
    else if (entryOrder2 == null) 
    {
    entryOrder2 = EnterLong(entry2ParamList[]);
    //any other code, like drawing some marker etc., goes here
    }
    else if (entryOrder3 == null) 
    {
    entryOrder3 = EnterLong(entry3ParamList[]);
    //any other code, like drawing some marker etc., goes here
    }
    //etc
    }

    Comment


      #17
      Thank you finally got it.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      85 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      48 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      29 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      32 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      67 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X