Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATM in ninja script strategy

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

    I am trying to plot a value from my strategy to a placeholder indicator from what the sample says. My question is what if I want to query that stored value in a placeholder? Does the value remain there in the placeholder? I want to access that value like this for example

    double j = placeholder.value[0];

    Comment


      Originally posted by luxurious_04 View Post
      I am trying to plot a value from my strategy to a placeholder indicator from what the sample says. My question is what if I want to query that stored value in a placeholder? Does the value remain there in the placeholder? I want to access that value like this for example

      double j = placeholder.value[0];
      As already clarified in another thread / post of yours - the concept of strategy communication is not supported currently unfortunately - however we've added it to our feedback under # 1002 and thank you for the input to further enhance our NinjaTrader platform.

      Comment


        Hello I would like to know if what is the cause of this problem:

        "Failed to execute DB job 'StrategyUpdateJob'. A foreign key value cannnot be inserted because a corresponding primary key value does not exits. [Foreign key constraint name = FK_nt_strategy2instrument_000000000000002A6]

        someone could help me on how to fix this issue. Thanks in advance.

        Comment


          luxurious_04, could you please recheck if you could reproduce the error message after repairing your DB under Tools > Options > Data? If you could still see it happen, please contact me with the scenario used via Help > Mail to Support and be sure to check the logs / trace option so we would have access to your diagnostic files from the platform.

          Thanks,

          Comment


            Hello, anyone there could help me on how to get the current price on the dom? I want to get price in dom which is in a red color or the current price. Not the Current bid/Ask. And how to know if my entered order has been stop out? Is there any code to check if the stop of my ATM is hit or I got stop out?

            Comment


              For the strategy stop / target monitoring you could use : http://www.ninjatrader.com/support/h...rgetorders.htm

              The current price is Close[0] with CalculateOnBarClose set to false in the script.

              Comment


                Not sure why you are interested in the price on the DOM. To the best of my knowledge there is no way to access the DOM in NinjaScript. Assuming CalculateOnBarClose is set to false, Close[0] should get you the value you are looking for.

                If your Stop order has been executed then your Strategy will no longer be running. Something like this could be used:
                // check if the strategy has terminated
                if (orderID.Length == 0 && atmStrategyID.Length > 0 && GetAtmStrategyMarketPosition(atmStrategyID) == Cbi.MarketPosition.Flat)
                {
                atmStrategyID = string.Empty;
                orderID = string.Empty;
                atmQty = 0;
                newAtmStopLoss = false;
                changeEntryOrder = false;
                Print("ATM strategy has closed.");
                }

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                650 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                370 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                109 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                574 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                577 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X