Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

WillVal

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

    WillVal

    hi.
    i tried to programm this indicator.
    Code:
    double FirstValue = (Closes[1][0] * Instruments[1].MasterInstrument.PointValue);
                    double SecondValue = (Closes[2][0] * Instruments[2].MasterInstrument.PointValue);
                    Spread.Set(((FirstValue-SecondValue) / (SecondValue+FirstValue))*100);
                    SMA1Spread.Set(SMA(Spread,MA1Period)[0]);
                    SMA2Spread.Set(SMA(Spread,MA2Period)[0]);
                    Pal.Set(SMA1Spread[0] - SMA2Spread[0]);
                    double WillVal = WilliamsR(Pal, palPeriod);
    but it doesn't works. what is the reason? it will be great to find a solution.

    #2
    Hello Clixmadine,

    Thank you for your post.

    What exactly does not work?

    What is the end goal for this indicator?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      i'll plot the variable WILLVAL but when i want to compile i got a message with the error code like this: CS0029 error code
      sadly i'm not so fit in the c# language.

      maybe you need the whole code?

      Comment


        #4
        Clixmadine,

        What is the full error message from the compile?

        Additionally, you can attach your script if you would like to help see where the error would be coming from.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          please take a look into the file.
          Attached Files

          Comment


            #6
            Clixmadine,

            You need to assign the index value to the WilliamsR()

            double WillVal = WilliamsR(Pal, palPeriod)[0];

            Try that out
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              ah cool, thanks. ok, now i can compile it. but it plots the spread not the willval.
              hmpf...

              Comment


                #8
                Clixmadine,

                That is because you are using the spread calculations for the Pal.Set();

                Try using the WillVal in place instead -
                Pal.Set(WillVal);
                Cal H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                607 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                353 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                560 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                561 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X