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 tkaboris, Today, 05:13 PM
      0 responses
      2 views
      0 likes
      Last Post tkaboris  
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,281 views
      0 likes
      Last Post Leafcutter  
      Started by WHICKED, Today, 12:45 PM
      2 responses
      19 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by Tim-c, Today, 02:10 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Taddypole, Today, 02:47 PM
      0 responses
      5 views
      0 likes
      Last Post Taddypole  
      Working...
      X