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 nandhumca, Yesterday, 03:41 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by The_Sec, Yesterday, 03:37 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by vecnopus, Today, 06:15 AM
    0 responses
    1 view
    0 likes
    Last Post vecnopus  
    Started by Aviram Y, Today, 05:29 AM
    0 responses
    5 views
    0 likes
    Last Post Aviram Y  
    Started by quantismo, 04-17-2024, 05:13 PM
    3 responses
    27 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X