Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DOM interaction with a non-ATM strategy

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

    DOM interaction with a non-ATM strategy

    Hi,

    I have read many threads about the need to interact with NinjaScript strategy generated entry orders from the DOM. I thought the concensus opinion is you can't do it without the strategy simply putting the order back as soon as it hit a new bar and the order was generated again.

    What I found is that you get an OnOrderUpdate event if you move the order. I just saved the original price, compared it to the new price and if they are different, I set a flag that says to use the new price.

    This lets me adjust the entry price for conditions that are too complicated to put in the strategy (i.e. even if the strategy says go long, don't go long 2 ticks from a downward sloping 2 hr EMA).

    I don't know if I was the only who didn't know this or if anyone will find it useful but I thought I would pass it along.

    Scott

    #2
    Scott,

    Manual manipulation is not recommended, but it can be done if your strategy is actually custom programmed to accommodate for price changes like that. Most people do not update their variables when they change prices and then that would make their logic go haywire if they manually manipulated an order.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh,

      I have designed and programmed algorithmic systems for years for various prop shops and hedge funds but am pretty new to NinjaScript (although my C# is excellent).

      Believe me I know how easy it is to get things out of sync and I am exceedingly careful. I have come to love the power and flexibility of NS, especially when augmented with some of the code I have assembled over the years.

      I was looking through the various events and knowing FIX very well, I started thinking about what the FIX messages would look like. From there, I figured out how to do all sorts of things

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      21 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      10 views
      0 likes
      Last Post cre8able  
      Working...
      X