Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Dive into manipulating C# code from within an unlocked NinjaScript strategy using the NinjaScript Editor.NinjaTrader 7 is an award winning end to end online ...


    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 geddyisodin, Yesterday, 05:20 AM
    8 responses
    51 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    10 responses
    36 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by DayTradingDEMON, Today, 09:28 AM
    4 responses
    24 views
    0 likes
    Last Post DayTradingDEMON  
    Started by George21, Today, 10:07 AM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by Stanfillirenfro, Today, 07:23 AM
    9 responses
    25 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X