Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Formula Multiplication

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

    Formula Multiplication

    I want to multiply a variable by a formula, e.g like this one:

    PER1[0] = (PER1[1] * (( 1 + b / 100 ) ^ ( 1 / p ));

    and PER1 is already defined OnBarUpdate()

    The Variable "b" and "p" are also declared in #region Variables:

    private int b=25;
    private int p=52;

    This way the line PER1 doesn't appear. If i declare like this:

    PER1[0] = (PER1[1] * 1.00005 ;

    the line appears correctly.

    How should I use the formula ?

    Thanks.

    #2
    Hello ManuelR,

    Have you added any prints to your script to see what value is being calculated by your formula?

    Please include the prints you have added and the output from the Output window so that we may see what values are being produced by this math.

    Below is a link to a video that describes the process of using prints to understand behavior.


    Are there any error messages in the Log tab of the Control Center?
    If so, what do these say?
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    566 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 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
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X