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 DJ888, 04-16-2024, 06:09 PM
    4 responses
    12 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by terofs, Today, 04:18 PM
    0 responses
    7 views
    0 likes
    Last Post terofs
    by terofs
     
    Started by nandhumca, Today, 03:41 PM
    0 responses
    6 views
    0 likes
    Last Post nandhumca  
    Started by The_Sec, Today, 03:37 PM
    0 responses
    3 views
    0 likes
    Last Post The_Sec
    by The_Sec
     
    Started by GwFutures1988, Today, 02:48 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Working...
    X