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

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 KennyK, 05-29-2017, 02:02 AM
                2 responses
                1,278 views
                0 likes
                Last Post marcus2300  
                Started by fernandobr, Today, 09:11 AM
                0 responses
                0 views
                0 likes
                Last Post fernandobr  
                Started by itrader46, Today, 09:04 AM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by timmbbo, Today, 08:59 AM
                0 responses
                2 views
                0 likes
                Last Post timmbbo
                by timmbbo
                 
                Started by bmartz, 03-12-2024, 06:12 AM
                5 responses
                33 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Working...
                X