NexusFi: Find Your Edge


Home Menu

 





Cumulative delta algo ?


Discussion in NinjaTrader

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




 
Search this Thread

Cumulative delta algo ?

  #1 (permalink)
 wwwingman 
Paris, France
 
Experience: Intermediate
Platform: SC, NT, ToS
Trading: CME & Eurex Futures
Posts: 116 since Apr 2011
Thanks Given: 339
Thanks Received: 194

Hi,

I use GomCD but would like to have a better understanding of the Cumulative Delta algorithm because it can be applied on volume but also on trades, etc...
This may look obvious, but I believe it is not. For ex, what happens when Bid=Ask.

I would appreciate your comments on :
1. the definition of cumulative delta volume
2. or, on the ninja pseudo code below.

Cumulatice delta volume is :
Delta is up when Price is at or above Ask, down when Price is at or below Bid.
when Ask = Bid, Delta is unchanged.

And can be coded as follow :
 
Code
double currentBid         = 0;
double currentAsk         = 0;
double currentPrice     = 0;
long   currentVolume   = 0;
long   cumulativeDelta     = 0;

protected override void OnMarketData(MarketDataEventArgs e)
{
    if    ( e.MarketDataType == MarketDataType.Bid ) 
        currentBid    =    e.Price;
    else if    ( e.MarketDataType == MarketDataType.Ask ) 
        currentAsk    =    e.Price;
    else if ( e.MarketDataType == MarketDataType.Last ) 
    {
        currentPrice = e.Price;
        currentVolume= e.Volume;
        
        if ( currentPrice >= currentAsk )
            cumulativeDelta += currentVolume;
        if ( currentPrice <= currentBid )
            cumulativeDelta -= currentVolume;
    }
}
Thank you.
W.

-- The rest is silence
Started this thread Reply With Quote




Last Updated on September 8, 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