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

How to plot swing volume

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

    How to plot swing volume

    Hi, I am using DrawText() and want to plot the volume for each swing high and swing low so that I may compare them.


    Also second question, how would I go about saving a value. For example if the close crossed above a swing high, I would like to save the value of the volume so that I may call it later.

    Would I accomplish this buy creating an Array? Could someone provide an example.

    Thanks.
    Last edited by brucelevy; 05-27-2017, 11:39 AM.

    #2
    Hello,

    Thank you for the post.

    You can find the syntax for accessing the Swing high and low here: http://ninjatrader.com/support/helpG...lightsub=swing

    You could use the swing in a condition like a normal indicator and check that the current swing high has changed from the previous bars high as one approach. You could then access the Volume using Volume[0]



    To store values, you could use variables. A simple example is the following:

    Code:
    private double myDouble;
    
    protected override void OnBarUpdate()
    {
        myDouble = Close[0];
    }
    If you want to store a value with a BarsAgo, you would instead need to use a DataSeries: http://ninjatrader.com/support/helpG...ries_class.htm

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    26 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, 02-22-2024, 01:11 AM
    5 responses
    32 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, Yesterday, 09:53 PM
    2 responses
    49 views
    0 likes
    Last Post wzgy0920  
    Started by Kensonprib, 04-28-2021, 10:11 AM
    5 responses
    192 views
    0 likes
    Last Post Hasadafa  
    Started by GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,234 views
    0 likes
    Last Post xiinteractive  
    Working...
    X