Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get the current dsiplayed price in the DOM

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

    Get the current dsiplayed price in the DOM

    I'm having a hard time understanding how to use what would be considered the DOM ladder price as part of my strategy. I just want to know where the current price is. If that price goes lower than say 1500 price level on the chart I would execute a trade.

    When I include and print Close[0] I get the actual close of each bar though many references here say to do this to receive current price. I included "Calculate = Calculate.OnEachTick;" in the state defaults:

    Code:
    if (State == State.SetDefaults)
    {
    Description = @"Sample ";
    Name = "Rus";
    Calculate = Calculate.OnEachTick;

    p
    Code:
    rotected override void OnBarUpdate()
    {
    Print("__" + Close[0]);
    This print statement returns the close of a 5 minute bar rather than the current price.

    How do I print the current price as it creates the bar to include in my strategy?

    This is part of a strategy that uses an indicator on a 5 minute chart within the strategy.

    Thanks!
    Chris
    Last edited by hireforwebsite; 10-22-2019, 01:24 PM.

    #2
    Hello, thanks for your note.

    Calculate = Calculate.OnEachTick would be the way to get the fastest price updates. Did you ensure to remove and re-add the strategy to your chart? This is required if you change anything in the OnStateChanged method.

    Comment


      #3
      Yes I did try that. I still receive the closing price of the 5 minute bar rather than a print out of the ticks as they create the 5 minute bar.

      Comment


        #4
        Hello, thanks for your reply.

        I attached a strategy that works on my side while connected to live data. Please add the attached file to Documents\NinjaTrader 8\bin\Custom\Strategies then compile.

        Please let me know if that does not work on your end.
        Attached Files

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        77 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        63 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X