• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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]

    http://ninjatrader.com/support/helpG...t7/volume2.htm

    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 Vincere, Yesterday, 11:20 PM
    0 responses
    3 views
    0 likes
    Last Post Vincere
    by Vincere
     
    Started by lMagi, 05-18-2019, 09:34 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by uday12, Yesterday, 10:26 PM
    0 responses
    2 views
    0 likes
    Last Post uday12
    by uday12
     
    Started by uday12, Yesterday, 10:07 PM
    0 responses
    0 views
    0 likes
    Last Post uday12
    by uday12
     
    Started by Nabil, Yesterday, 07:46 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X