Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Average Daily Volume / Volume

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Average Daily Volume / Volume

    Hi,

    I'm coding an indicator made especially for the Market Analyzer.

    Okay, I found the Market Analyzer indicators and I'm trying to use them as a template to create another.

    I'd like to compare the percentage of session completed to the percentage of volume accumulated compared to the Average Daily volume thus giving me an indication of how a stock is progressing volume wise.



    time passed in session / duration of session (6.5 hours)

    compared to:

    Volume accumulated today / Average Daily Volume


    so isn't that:

    ((ToTime(Time[0])-83000)/65000); - in my time zone the open is at 8:30 / session is 6.5 hours

    Darn - this doesn't work as time isn't a base 10 system. Any suggestions how to calculate time passed in session?

    compared to:

    Volume[0]/(SMA(Volume, 200) [0]);



    Okay, I see they are Fundamental Data types. Can I use them like I would a chart indicator. Can these e.values fit into formulas?
    Last edited by stockgoblin; 10-29-2012, 07:20 AM.

    #2
    Stockgoblin,

    You can exploit DateTime objects here. For example,

    if ( FirstBarOfSession )
    {
    // create a new MyTime object and set it to have the current time
    }

    int hours_passed = Math.Abs(MyTime.Hour - DateTime.Now.Hour);

    Note this would only return hours as whole numbers (well integers), so you may also want to track minutes.

    Represents an instant in time, typically expressed as a date and time of day.


    DateTime objects are part of .NET and have a lot of neat functionality built into them.
    Last edited by NinjaTrader_AdamP; 10-29-2012, 07:51 AM.
    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SnailHorn, 05-02-2024, 10:49 PM
    3 responses
    27 views
    0 likes
    Last Post SnailHorn  
    Started by giulyko00, Today, 11:49 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by marksingh87, 02-13-2024, 04:55 PM
    6 responses
    210 views
    1 like
    Last Post mshrstv
    by mshrstv
     
    Started by SnailHorn, Today, 08:38 AM
    2 responses
    4 views
    0 likes
    Last Post SnailHorn  
    Started by Skifree, Yesterday, 11:38 PM
    1 response
    16 views
    1 like
    Last Post NinjaTrader_LuisH  
    Working...
    X