Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Run strategy from strategy by property name

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

    Run strategy from strategy by property name

    Hello, guys.

    I am try to write my first strategy. Implemented a lot of indicators, but strategy for me will be the first one and need your help.

    Lets say I have entered 3 buy orders and i have 3 sel limit orders in different levels.
    The question is:
    1) how programatically recognize and find the sell limit order wich has the highest price (for this example) ?

    2) how to run another strategy by property name , when the price take the last Sell Limit ?

    See what I want in attached example.
    Thank you !!!
    Attached Files

    #2
    Hello Akushyn,

    1) You can use Math.Max() for this -
    Math.Max(order1, Math.Max(order2, order3));

    2) how to run another strategy by property name , when the price take the last Sell Limit ?
    I'm not sure what you mean here, can you elaborate?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the reply.
      I'll try to explain what I want. I have another strategy wich works with position.
      When I enter the market I would like to run this strategy to monitor what is going on with my position on the market.

      Like this...

      if (condition)
      {
      EnterLong(...);
      RunStrategy(strategyName);
      }
      else {
      EnterShort(....);
      RunStrategy(strategyName);
      }

      where strategyName pass to the strategy as a property name.

      Also, please, could you send me some links of existed strategy examples and tips of working with orders....
      Thank you.

      Comment


        #4
        Hello Akushyn,

        You will not be able to call another strategy from your strategy. You would have to work the logic in your main strategy that you use from the other script.

        Additionally, the NinjaScript File Sharing threads are a great place for sample scripts as well as our Reference samples both links below -
        http://www.ninjatrader.com/support/f...splay.php?f=40
        http://www.ninjatrader.com/support/f...splay.php?f=30
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        592 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        554 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X