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 kinfxhk, 07-14-2026, 09:39 AM
      0 responses
      101 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 10:18 AM
      0 responses
      94 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 09:50 AM
      0 responses
      72 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 07:21 AM
      0 responses
      90 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-11-2026, 02:11 AM
      0 responses
      68 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X