Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Suggestion 24.02.2018 - correct FormatPriceMarker toward Databox

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

    Suggestion 24.02.2018 - correct FormatPriceMarker toward Databox

    I see that on charts, the DataBox is not flexible to the chart instrument.
    For example, on EUR/USD (or other forex charts), you see that databox shows Plot values rounded to 2 decimals, like:

    1.23

    However, this is very unflexible, and I have to use custom codes to make the Databxo to be adequate to the current chart instrument:



    Code:
                   public override string FormatPriceMarker(double price)
    		{
    		    return price.ToString("N"+ decimals(this));
    		}     
    
    		public int decimals(NinjaTrader.NinjaScript.Indicators.Indicator x){
    			double tickSize = x.Instrument.MasterInstrument.TickSize;
    			int decimals =0;
    			if(tickSize ==1)		{ decimals = 0; }
    			else if(tickSize ==0.5)	{ decimals = 1; }
    			else if(tickSize ==0.25) 	{ decimals = 1; }
    			else if(tickSize ==0.1)	{ decimals = 1; }
    			else if(tickSize ==0.01) 	{ decimals = 2;	}
    			else if(tickSize ==0.001)	{ decimals = 3;	}
    			else if(tickSize ==0.005)	{ decimals = 3;	}
    			else if(tickSize ==0.025)	{ decimals = 3;	}
    			else if(tickSize ==0.03125)	{ decimals = 3;	}
    			else if(tickSize ==0.0001)	{ decimals = 4;	}
    			else if(tickSize ==1E-05) 	{ decimals = 5;	} //0.00001
    			else if(tickSize ==5E-05) 	{ decimals = 5;	} //0.00005
    			else if(tickSize ==1E-06) 	{ decimals = 6;	} //0.000001
    			else if(tickSize ==1E-07) 	{ decimals = 7;	} //0.0000001
    			else if(tickSize ==5E-07) 	{ decimals = 7;	} //0.0000005
    			return decimals;
    		}

    and please, do something that NT did that automatiaclly, to choose the correct precision for databox values (i.e. even onto databbox window, there might be some kind of "settings" button to regulate that too).

    #2
    Hello TazoTodua,

    Thanks for opening the thread.

    This is a known item that the the Data Box has it's own rounding behavior.

    This is being tracked with feature request ticket ID SFT-719. "Allow plot values in the Data Box to use the same rounding as the value itself" I'll submit a vote on your behalf.

    Please keep in mind, feature requests are fulfilled based on the development team's priorities and we cannot offer an ETA or promise of fulfillment. Upon implementation, the ticket ID's can be seen in the Release Notes page of the help guide.

    Release Notes: https://ninjatrader.com/support/help...ease_notes.htm

    Please let us know if we can be of additional help.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    26 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, 02-22-2024, 01:11 AM
    5 responses
    32 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, Yesterday, 09:53 PM
    2 responses
    49 views
    0 likes
    Last Post wzgy0920  
    Started by Kensonprib, 04-28-2021, 10:11 AM
    5 responses
    192 views
    0 likes
    Last Post Hasadafa  
    Started by GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,234 views
    0 likes
    Last Post xiinteractive  
    Working...
    X