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

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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by HTrader, Yesterday, 09:12 PM
    2 responses
    12 views
    0 likes
    Last Post HTrader
    by HTrader
     
    Started by firstlanetech, Yesterday, 08:56 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by robbersdog, Yesterday, 07:55 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by SuperDude123, Yesterday, 09:08 AM
    2 responses
    42 views
    0 likes
    Last Post SuperDude123  
    Started by trader3000a, Yesterday, 08:01 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X