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 trilliantrader, 04-18-2024, 08:16 AM
    4 responses
    18 views
    0 likes
    Last Post trilliantrader  
    Started by mgco4you, Today, 09:46 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by wzgy0920, Today, 09:53 PM
    0 responses
    9 views
    0 likes
    Last Post wzgy0920  
    Started by Rapine Heihei, Today, 08:19 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 08:25 PM
    0 responses
    10 views
    0 likes
    Last Post Rapine Heihei  
    Working...
    X