NexusFi: Find Your Edge


Home Menu

 





int to byte conversion


Discussion in NinjaTrader

Updated
    1. trending_up 2,226 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
ural01's Avatar
 ural01 
Colorado Springs, CO
 
Experience: Master
Platform: NinjaTrader
Broker: GAIN CAPITAL
Trading: Currency Futures
Posts: 24 since Mar 2010
Thanks Given: 9
Thanks Received: 0

Hello !!! have any one try to sped optimization with replacing private variables int with byte ?
any code examples how to convert int to byte


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Beijing Summit Closes: Xi Pledges Hormuz Help -- $1.14B …
Prediction Markets & Event Contracts
MyForexFunds Begins Returning Frozen Funds After CFTC Ca …
Funded Trading Evaluation Firms
$500M Riding on World Cup 2026: France/Spain Co-Favored …
Prediction Markets & Event Contracts
The Week Ahead -- CPI Wednesday With Oil Past $90, PPI L …
Traders Hideout
CME Raises Energy Futures Margins After Iran-War Volatil …
Commodities
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #2 (permalink)
 i960 
San Francisco, CA
 
Experience: Advanced
Platform: SC, eSignal
Broker: IB
Trading: Spreads
Posts: 46 since Jan 2015
Thanks Given: 44
Thanks Received: 43


ural01 View Post
Hello !!! have any one try to sped optimization with replacing private variables int with byte ?
any code examples how to convert int to byte

False optimization usually. Modern 64-bit CPUs use a native 8-byte word w/ hardware support for 4-byte words. It's actually slower to use a 8-bit char/byte than a 32 or 64-bit int with one exception: storage or payload size. You're probably not dealing those latter issues here so stick to simple ints.


Reply With Quote
Thanked by:
  #3 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
Quantoholic
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,971 since Jun 2009
Thanks Given: 534
Thanks Received: 3,711



ural01 View Post
Hello !!! have any one try to sped optimization with replacing private variables int with byte ?
any code examples how to convert int to byte

 
Code
int x=5;
byte b = (byte) x;
byte c = (byte) 300; // error, a  byte must be between 0 and 255
But like @i960 said, it's probably not going to help you much because of 32 or 64-bit word sizes in today's CPUs. It can help with file and database storage optimization though.


Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on August 8, 2015


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts