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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        87 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        106 views
        0 likes
        Last Post CarlTrading  
        Working...
        X