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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    133 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    75 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    117 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    113 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    90 views
    0 likes
    Last Post CarlTrading  
    Working...
    X