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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        79 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        146 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        79 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        52 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        56 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X