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 4,807 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

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

  #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?
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 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,713 since May 2010
Thanks Given: 203
Thanks Received: 2,686


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 Twitter 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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts