Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Show how much the price has moved in ticks/pips

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

    Show how much the price has moved in ticks/pips

    I don't have experience in writing NT script but I need a simple indicator which will show in terms of how many the ticks/pips a price has risen or fallen since I start the indicator (or when I'm connected to the data feed).

    For example, if ES was at 1703.00 when I am first connected to the data feed and now the price is at 1704.25, the indicator should show or plot 5. 30 second later, ES is at 1703.50, the indicator should show or plot 2.

    Any guidance with the code here? Or is there an existing indicator out there which is doing this already?

    Thanks

    #2
    Originally posted by jim380 View Post
    I don't have experience in writing NT script but I need a simple indicator which will show in terms of how many the ticks/pips a price has risen or fallen since I start the indicator (or when I'm connected to the data feed).

    For example, if ES was at 1703.00 when I am first connected to the data feed and now the price is at 1704.25, the indicator should show or plot 5. 30 second later, ES is at 1703.50, the indicator should show or plot 2.

    Any guidance with the code here? Or is there an existing indicator out there which is doing this already?

    Thanks
    What happens if you restart the indicator mid-session? Should it retain what you had, or should it start afresh, ignoring everything that came before the restart?

    Comment


      #3
      Originally posted by koganam View Post
      What happens if you restart the indicator mid-session? Should it retain what you had, or should it start afresh, ignoring everything that came before the restart?
      It should re-start all over again. I won't need it to take into account what was before it. Thanks

      Comment


        #4
        Hello jim380,

        I am not aware of an Indicator that would do something like that but you may do something like this:

        Code:
        private double initialPrice = 0;
        
        protected override void OnBarUpdate()
        {
        	if(Historical)
        		return;
        	if(initialPrice == 0)
        	{
        		initialPrice = Close[0];
        	}
        	else
        	{				
                   	PriceAction.Set(initialPrice-Close[0]);
        	}
        }
        This will simple make sure that it will not run on any historical data and then plot the change in price from when you start it.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        331 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        550 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X