NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Educational Resources > Reference Samples

Reference Samples Official NinjaScript reference code samples

Reply
 
Thread Tools Display Modes
Old 07-28-2009, 04:15 PM   #1
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default Strategy: Rounding values to the nearest tick size

Reference sample for NinjaTrader 6.5.xxxx.x or greater.

When NinjaTrader receives a request to submit an order, it automatically rounds any limit price or stop price to the nearest tick for that specific instrument. When debugging and/or printing out order information, this may not be apparent. NinjaTrader includes a callable function named Round2TickSize to apply the same internal rounding to any value you wish, which can help make comparisons easier.

This reference sample demonstrates the following concepts:
  • Rounding a value to the nearest tick
Important methods and properties used include:Other methods and properties of interest include:Import instructions for NinjaTrader 6.5.XXXX.X or greater:
  1. Download the file contained in this thread to your PC desktop
  2. From the Control Center window, select the menu File > Utilities > Import NinjaScript
  3. Select the downloaded file
Attached Files
File Type: zip SampleRound2TickSize.zip (3.1 KB, 482 views)
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rounding down to nearest tick gdgeddie General Programming 2 07-26-2009 05:01 PM
rounding of values anniebee Suggestions And Feedback 4 06-21-2009 12:09 AM
Rounding to nearest TickSize increment ctrlbrk General Programming 3 04-13-2009 07:46 AM
How can I get market tick size? maxima Indicator Development 2 05-04-2008 10:54 AM
Round to Nearest Tick tquinn General Programming 2 01-30-2007 07:20 AM


All times are GMT -6. The time now is 08:48 PM.