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

cannot implicitly convert type 'double' to 'bool'

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

    cannot implicitly convert type 'double' to 'bool'

    What does this mean? Below are the parameters i have...

    double value5 = PriorDayOHLC().PriorClose[1];
    double value6 = PriorDayOHLC().PriorOpen[1];
    double valuex = 0;

    if (value5 = value6)
    {
    valuex = (((
    2*value5) + truehigh + truelow)/2);
    }

    For other 'if' statements like
    if
    (value5 < value6) and
    if
    (value5 > value6)

    there were no error messages. Please help.

    #2
    kaywai, to check if something is equal, please use ' == '.

    A equal sign is just an assignment (i.e. myValue = 100).
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Perfect! Thanks Bertrand!

      Another question I have is say for valuex, I have derived a value and would like to draw a line at that data point in a minute chart across the trading day. How would I be able to do that?

      Comment


        #4
        Try for example such a call -

        Code:
         
        DrawLine("myLine1", Bars.BarsSinceSession, 1100, 0, 1100, Color.Chocolate, DashStyle.Dot, 3);
        1100 is your custom value for Y axis then.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks Bertrand!

          Comment


            #6
            Bertrand, would you mind taking a look at this line for me? I've gotten 5 similar lines to draw but this particular line just won't draw! I tried the Print function and I am able to get a value...please help!

            projectedlow = (valuex - truehigh);
            DrawLine(
            "myLine2", Bars.BarsSinceSession, projectedlow, 0, projectedlow, Color.Red, DashStyle.Solid, 2);

            Comment


              #7
              You should check the Control Center logs for errors. If you are drawing outside the visible range of the y-axis you will also not see that line depending on the y-value you are drawing at.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Yup. It is "out of range". Is there any way we can shift the chart up and down?

                Comment


                  #9
                  kaywai,

                  Drag the y-axis with your mouse to bring more price ranges into view.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Josh, I can drag to left to right and vice versa. I can't drag the chart up and down though. BTW i'm not using NT7...

                    Comment


                      #11
                      kaywai,

                      Drag the actual y-axis itself, not the chart.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Josh, NT is amazing!

                        Both you and Bertrand have been a tremendous help this week!

                        I would like to wish the both of you an excellent weekend!

                        Kay Wai

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by kempotrader, Today, 08:56 AM
                        0 responses
                        7 views
                        0 likes
                        Last Post kempotrader  
                        Started by kempotrader, Today, 08:54 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post kempotrader  
                        Started by mmenigma, Today, 08:54 AM
                        0 responses
                        2 views
                        0 likes
                        Last Post mmenigma  
                        Started by halgo_boulder, Today, 08:44 AM
                        0 responses
                        2 views
                        0 likes
                        Last Post halgo_boulder  
                        Started by drewski1980, Today, 08:24 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post drewski1980  
                        Working...
                        X