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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      67 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      36 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      59 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X