Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

parabolic sar

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

    parabolic sar

    how can i determine candle[0] is below or above parabolic sar?
    for up trend i use :
    double value=ParabolicSAR(0.02,0.2,0.02)[0];​
    if ( candle[0] > value)

    for down trend i use:
    if ( candle[0] < value)

    but its not work correctly.
    how can i fix this?

    #2
    Hello f.saeidi,

    If you want the Close price of the bar use Close[0].

    If you want the Low price of the bar use Low[0].

    Code:
    Print(string.Format("{0} | Low[0]: {1} > ParabolicSAR(0.02,0.2,0.02)[0]: {2}", Time[0], Low[0], ParabolicSAR(0.02,0.2,0.02)[0]));
    
    if (Low[0] > ParabolicSAR(0.02,0.2,0.02)[0])
    {
    Print(Time[0] + " | the Low of the bar is greater than the ParabolicSAR");
    }
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thnx for notes.
      I don't need create parabolic for candle0 and candle 1?
      For example
      If (sar candle 0 > sar candle 1) trend is up
      If (sar candle 0 <sar candle 1) trend is down.
      Can I use above method?

      Comment


        #4
        Hello f.saeidi,

        I'm not quite sure what you are asking.

        Are you asking if you can compare the Low of the current bar with the ParabolicSAR() value from the previous bar (1 bar ago)?

        if (CurrentBar > 1 && Low[0] > ParabolicSAR(0.02,0.2,0.02)[1])
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I guess ur mention script don't work well.
          I just want when parabolic sar in above candle tell me down trend and when parabolic sar is below candle tell me up trend.
          I understand we must compare candle 0 and candle 1 parabolic sar condition to determine what is the trend.

          Comment


            #6
            Hello f.saeidi,

            I've tested this and I am seeing this is working as expected.

            Below is a link to a video.



            "I just want when parabolic sar in above candle tell me down trend and when parabolic sar is below candle tell me up trend."

            I'm not clear on what this means. Can you specific on what values you want compared and how you want them compared?

            "when parabolic sar in above candle"

            Do you mean the Low[0] of the current bar is greater than the value returned from the ParabolicSAR indicator?

            "candle tell me down trend"

            Do you mean the Close[0] of the current bar is greater than the Close[1] of the previous bar?



            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thnx for notes.
              You use low and high for parabolic sar.
              I use current bid value and I will try your method.
              Best regard

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              599 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              344 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              558 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              557 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X