NexusFi: Find Your Edge


Home Menu

 





dealing with GetCurrentBidVolume and GetCurrentAskVolume , "long" casting into "int"


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one jmejedi with 2 posts (0 thanks)
    2. looks_two Quick Summary with 1 posts (0 thanks)
    3. looks_3 bukkan with 1 posts (0 thanks)
    4. looks_4 NinjaTrader with 1 posts (0 thanks)
    1. trending_up 5,773 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
jmejedi's Avatar
 jmejedi 
Lilburn, GA
 
Experience: Beginner
Platform: NinjaTrader
Broker: VelocityFutures/TT
Trading: ES
Posts: 62 since Jan 2011
Thanks Given: 13
Thanks Received: 4

alright ,,,,,, so ....... "GetCurrentBidVolume" and "GetCurrentAskVolume" ,,,,,,,,,,,,,, returns a "Long" . . . . . . . . . and I am wanting to do the following:

Get the difference between these two . . . and see if the difference is less than X [where is a "int"]


,,,,,,,,,,,,,,,,,,,,,,,,,,,,, wanted to get your recommendations on this (please) ? ? ?


{ want to see how best to deal with this . .


Also ,,,,, any idea why NT made these two return a "Long" instead of a "int" . . . . I would think that a "int" would be enough to account for the normal sizes seen on the Bids & Asks volumes ,,, take for example the ES ,,,,,,,

}




Thanks in advance ,

Jimmy M. Espana


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Tradeify 3.0 Overhauls Futures Prop Firm Model -- One-Ti …
Funded Trading Evaluation Firms
Thursday May 28: GDP + Core PCE + Jobless Claims All at …
Traders Hideout
Khamenei Vetoes Uranium Transfer as Peace Odds Surge to …
Prediction Markets & Event Contracts
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #3 (permalink)
 
NinjaTrader's Avatar
 NinjaTrader  NinjaTrader is an official Site Sponsor
Site Sponsor

Web: NinjaTrader
AMA: Ask Me Anything
Webinars: NinjaTrader Webinars
Elite offer: Click here
 
Posts: 1,715 since May 2010
Thanks Given: 203
Thanks Received: 2,688


Is this what you are looking for?

if (Math.Abs(GetCurrentAskVolume(0) - GetCurrentBidVolume(0)) < x)
// Do something

Also, an "int" was not large enough in some cases for volume, specifically stocks.


Follow me on X Reply With Quote
  #4 (permalink)
 
jmejedi's Avatar
 jmejedi 
Lilburn, GA
 
Experience: Beginner
Platform: NinjaTrader
Broker: VelocityFutures/TT
Trading: ES
Posts: 62 since Jan 2011
Thanks Given: 13
Thanks Received: 4

question about


Math.Abs( )


... does this return a "int" ?

furthermore, Math.Abs can deal with "long"s and "double"s .... right ??

for example:

Y = Y - Math.Abs(DOUBLE);

(where Y is a "int")



Thanks in advance,

Jimmy Espana


Started this thread Reply With Quote
  #5 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271

int BidAskDiff = (int)(GetCurrentAskVolume() - GetCurrentBidVolume());

do note this may result in -ive value. if you do not want a -ive value then do use Math.Abs as Ray mentioned.


Reply With Quote




Last Updated on May 23, 2011


© 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