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 6,114 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?
My Rant with AMP Futures
Trading Reviews and Vendors
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
Building a free browser DOM/SMC simulator - need some ad …
Platforms and Indicators
What we know about Binances $6.3bn hack - BBC News
Cryptocurrency
AI for Traders — Agents, Memory, Tools & Real-Worl …
Elite Quantitative GenAI/LLM
 
  #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,689


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: 279 since Jun 2009
Thanks Given: 161
Thanks Received: 272

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