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

Volumetric MaxVolume Bar Data

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

    Volumetric MaxVolume Bar Data

    Hi,

    I've been able to figure out how to print the maximum value of both the bid and ask volume and it's price on a volumetric bar with this code below in teal. Since I now know that it's possible to get that information drawn, I'd like to get that price into a strategy where the maximum volume price level is what is looked at in the logic. How can I get the strategy to look at just the price level (not the volume) and uses something like this: if (GetMaximumVolume(null, out price)[0] > GetMaximumVolume(null, out price)[1])

    Does that make sense what I'm trying to do?

    Thanks,
    Jack

    try
    {
    double price;

    Draw.Text(this, "test1" +CurrentBar, "" + barsType.Volumes[CurrentBar].GetMaximumVolume(null, out price) + " " + price, 0, High[0] + 8 +TickSize);

    //GetMaximumVolume(null, out price)[0] = barsType.Volumes[CurrentBar].GetMaximumVolume;
    }
    catch{}

    #2
    Hi Seastragg, thanks for posting.

    GetMaximumVolume is the correct method to use for getting the price level where the max volume occurred in a given bar. E.g.

    Code:
    double price1, price2;
    
    barsType.Volumes[CurrentBar].GetMaximumVolume(null, out price1);
    barsType.Volumes[CurrentBar-1].GetMaximumVolume(null, out price2);
    
    if(price1 > price2)
    {
        Print("signal");
    }
    Best regards,
    -ChrisL
    Last edited by NinjaTrader_ChrisL; 12-17-2021, 12:24 PM.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi Chris,

      is the ">" that you have there supposed to be a > ?

      Also, instead of print, can it be turned into a true false statement?

      Cheers,
      Jack

      Comment


        #4
        Hi Jack,
        That's correct, the forum turned my > to a code. That is a boolean statement that can be used in a condition. I just added the Prints because it's always helpful to use prints to see the data coming from the strategy. I fixed the code above.

        Best regards,
        -ChrisL
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pibrew, Today, 06:37 AM
        0 responses
        4 views
        0 likes
        Last Post pibrew
        by pibrew
         
        Started by rbeckmann05, Yesterday, 06:48 PM
        1 response
        14 views
        0 likes
        Last Post bltdavid  
        Started by llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        11 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        16 views
        0 likes
        Last Post AaronKoRn  
        Working...
        X