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 DannyP96, 05-18-2026, 02:38 PM
    1 response
    89 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    143 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    83 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    257 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    334 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X