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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      111 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      158 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      78 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      125 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      79 views
      0 likes
      Last Post PaulMohn  
      Working...
      X