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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X