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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    619 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    420 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    293 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    415 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    367 views
    0 likes
    Last Post CarlTrading  
    Working...
    X