Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

simple math question

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

    simple math question

    I'm trying to add a 3rd line to the Stochastics %K and %D lines, where my third will be =
    (3K - 2D)

    right now i have two lines of code that read:

    jvalue=(int) Math.Round((3*D)-(2*K));

    J.Set(jvalue);


    my guess is i'm missing a [0] somewhere, but my attempts so far haven't worked.... can anyone help?

    #2
    To calculate the value of J using the current values of %D and %K, you'll need to access the '0th' (current) item in the indicator's value series, as so:

    jvalue=(int) Math.Round((3*stochasticsVariable.D[0])-(2*stochasticsVariable.K[0]));

    J.Set(jvalue);

    Hope this helps!

    Comment


      #3
      ah it seems to work now, thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      580 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      336 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X