Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Comparing Bar OHLC with a Custom Indicator Value

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

    Comparing Bar OHLC with a Custom Indicator Value

    Hi guys,

    I'm building a strategy in NT8 using a custom VWAP indicator in circulation called VWAP8. I am able to add this indicator to my strategy and it plots fine.

    I am also able to use functions such as CrossBelow() and CrossAbove() in reference to this indicator plot, however I am looking for proper syntax to determine if the last bar closed above (or below) the plot of this indicator for example. Thanks in advance!

    #2
    Hello gambOtage,

    Thank you for your note.

    To determine if the current price closed above the vwap you would reference Close bars ago 0 and VWAP bars ago 0 with an operator of Greater.

    I attached a screen shot of how this could be done. If you were interested in whether this happened on the last bar, not the current bar, you would pass 1's to the bars ago input on both sides.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hi Alan,

      Thank you for your assistance. I have an indicator "VWAP8" installed and similar to your solution within the Strategy Builder I am trying to add this condition in conjunction with my other criteria which does compile and run fine. The attached image is for short signal so operator is Less than the last bar.

      The compiler errors out on a double datatype error. What am I doing wrong?
      Attached Files

      Comment


        #4
        So I figured out the issue based on your suggestion. Passing [0] to the indicator name. Seems like this should work universally depending on the indicator. Thanks for your help,

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        52 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        70 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X