Announcement

Collapse
No announcement yet.

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 letilleulskin, Today, 11:33 PM
                        0 responses
                        2 views
                        0 likes
                        Last Post letilleulskin  
                        Started by letilleulskin, Today, 11:29 PM
                        0 responses
                        2 views
                        0 likes
                        Last Post letilleulskin  
                        Started by MatthewLesko, Today, 11:13 PM
                        0 responses
                        3 views
                        0 likes
                        Last Post MatthewLesko  
                        Started by Lance El Camino, Today, 04:14 PM
                        1 response
                        13 views
                        0 likes
                        Last Post s.kinra
                        by s.kinra
                         
                        Started by jtrading82, Today, 04:56 PM
                        1 response
                        10 views
                        0 likes
                        Last Post NinjaTrader_ShawnB  
                        Working...
                        X