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?
Five Days Until the Gap Dies -- CME Goes 24/7 on All Dig …
Traders Hideout
OneChronos Launches First Combinatorial Auction FX Venue …
Currencies
Kharg Island at 6%, Regime Fall at 1.5% -- The Black Swa …
Prediction Markets & Event Contracts
Hormuz Normalization Collapses to 19.5% -- Iran Regime F …
Prediction Markets & Event Contracts
Kalshi Sets $4.13B All-Time Weekly Record as Polymarket …
Prediction Markets & Event Contracts
 
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