Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

? Price = 0.75

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

    ? Price = 0.75

    I'm fairly new to coding, I'm trying to Draw a dot above High[0] == 0.75 Price, lets say every price that has a High of 0.75 of a price, say 1245.75 any suggestions

    This is what I have so far:

    if (High[0] == 0.75)
    {
    DrawDot("My dot" + CurrentBar, false, 0, High[0] + TickSize, Color.Red);
    }
    Last edited by sunfirerv; 10-01-2015, 06:19 AM.

    #2
    Hello sunfirerv,

    Thanks for your post.

    You'll want to convert the double price to integer by casting to drop the decimal.

    Code:
    int highprice = (int)High[0];
    
    if ( High[0] - highprice == 0.75)
    {
    DrawDot("My dot" + CurrentBar, false, 0, High[0] + TickSize, Color.Red);
    }

    Comment


      #3
      Really new, not sure how to do that?

      Comment


        #4
        Hello sunfirerv,

        Thanks for your reply.

        This line: int highprice = (int)High[0]; Creates an integer (whole number) variable named highprice. (int)High[0] casts the integer value of the currentbars High value into highprice.

        The next statement, if ( High[0] - highprice == 0.75) subtracts the whole number highprice from the decimal value of High[0] and then tests to see if 0.75 remains.

        Here is a reference: http://www.dotnetperls.com/cast-int

        Comment


          #5
          Thanks very much.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          157 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          307 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          244 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          346 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          176 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X