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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        89 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        135 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        119 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        69 views
        0 likes
        Last Post PaulMohn  
        Working...
        X