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

Using Variables in Strategy Builder

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

  • johnMoss
    replied
    Thank you Kate, perfect...

    Leave a comment:


  • NinjaTrader_Kate
    replied
    Hello johnMoss,

    Thank you for your post.

    It would not be possible to achieve what you've described using the Strategy Builder - its calculation abilities are pretty limited.

    That being said, it wouldn't be impossible to achieve this with manual coding. I'm attaching an example strategy that shows how this could be achieved.

    Here is a basic guideline of how to import NinjaScript add-ons in NinjaTrader 8:

    Note — To import NinjaScripts you will need the original .zip file.

    To Import:
    1. Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
    2. From the Control Center window select the menu Tools > Import > NinjaScript Add-on...
    3. Select the downloaded .zip file
    4. NinjaTrader will then confirm if the import has been successful.

    Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'

    Once you've imported this, you can view it in the NinjaScript editor to see how it's set up.

    Please let us know if we may be of further assistance to you.
    Attached Files

    Leave a comment:


  • johnMoss
    started a topic Using Variables in Strategy Builder

    Using Variables in Strategy Builder

    I have a suspicion this is outside the scope of the wizard, but since an opportunity to add variables is included in the strat builder (NT8. ) I'm curious as to their application. To wit:

    1) One can enter variables yes, but the in entry box itself one can only enter the usual parameters offered above as user inputs.
    2) As there are no other questions asked by the wizard as to what to do with it; it appears to simply be nothing more than a static object. A true variable is of course typically surrounded by an argument which upon evaluation the variable value is declared.
    3) My objective:
    On execution, (bar close for example) capture a real-time numeric value derived from one indicator, take this value and multiply it by the 'variable', and then use it to set a period value for another indicator; for further entry evaluation & potential execution. Clearly order of execution matters in this case as well. In the moment I intend on deriving the value of this variable multiplier manually through a series of tests. Once derived however I still need to apply it into the execution sequence.
    4) So, if possible with the wizard, how do I capture (value 'A 'from indicator A) | multiply this value by static (Variable V) | take this value and use it to set indicator B lookback period (BP) ?
    5) I know what to do to call the BP variable into play, so question is really about creating an instance of "A * V new value; storing it momentarily as "variable 2" and calling this V2 to become the indicator B period setting upon which evaluation continues.


    "A * V = BP

    If not possible in the builder, anyone have a piece of code laying around ?

    Thanx

    JM
    Last edited by johnMoss; 04-08-2020, 10:55 PM.

Latest Posts

Collapse

Topics Statistics Last Post
Started by BarzTrading, Today, 07:25 AM
2 responses
13 views
1 like
Last Post BarzTrading  
Started by devatechnologies, 04-14-2024, 02:58 PM
3 responses
19 views
0 likes
Last Post NinjaTrader_BrandonH  
Started by tkaboris, Today, 08:01 AM
0 responses
3 views
0 likes
Last Post tkaboris  
Started by EB Worx, 04-04-2023, 02:34 AM
7 responses
162 views
0 likes
Last Post VFI26
by VFI26
 
Started by Mizzouman1, Today, 07:35 AM
1 response
9 views
0 likes
Last Post NinjaTrader_Gaby  
Working...
X