Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculating Dollar Volume

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

    Calculating Dollar Volume

    Hello,

    I am wanting to create a variable which provides me the dollar volume (closing price at end of minute times the number of shares traded during that minute) of each candle and then use it to determine whether or not my trade should execute. I created the following variable hoping it would do the job:

    private double dollarVolume;
    private double dollarVolumeMin = 1000000


    dollarVolume = (Close[0] * Volume[0]);

    (execute trade when) dollarVolume > dollarVolumeMin

    Is there a way from me to see what value is behind this variable now? I have applied it in my strategy and it doesn't seem to be working. Any help would be appreciated.

    Kenson

    #2
    Hello Kenson,

    Thanks for your post.

    Debugging prints would be used for this purpose. They can be made with Print() and they will be displayed in the NinjaScript Output window. (Control Center > New > NinjaScript Output) You could also consider using Draw.TextFixed to present values on the chart.

    Draw.TextFixed() - https://ninjatrader.com/support/help..._textfixed.htm

    Debugging Tips - https://ninjatrader.com/support/help...script_cod.htm

    Let us know if there is anything else we can do to help.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    602 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    347 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    559 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    558 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X