Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Subtracting from a double

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

    Subtracting from a double

    I want to subtract 2 pips from a low. How do I do that?

    I have
    Code:
    MIN(Low, 3)[0] - 2 * TickSize
    but am getting the error
    Operator '-' cannot be applied to operands of type 'string' and 'double'

    #2
    Originally posted by lifzgreat View Post
    I want to subtract 2 pips from a low. How do I do that?

    I have
    Code:
    MIN(Low, 3)[0] - 2 * TickSize
    but am getting the error
    That looks correct. Are you sure that your error is coming from that line in that indicator? Maybe you could post a snapshot of your error screen ?
    Last edited by koganam; 06-21-2013, 10:12 AM. Reason: Corrected spelling.

    Comment


      #3
      I feel silly. I had that code in the middle of a string w/o enclosing it in parens. I changed that and now I have no error. Sorry!

      Code:
      Print("SL should be " + (MIN(Low, 3)[0] - 2 * TickSize));

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      76 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      22 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      29 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      29 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X