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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      72 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      39 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X