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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      59 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      143 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      161 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      97 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      276 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X