Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need to calculate some correlations, is there any built in function?

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

    Need to calculate some correlations, is there any built in function?

    Hi there, I would like to calculate something simple like for example.. is there any correlation between the price being 10% above open in the first hour and 10% below open in the 2nd hour. And the average percentage difference between the open and the max price in the 1st hour, and the same for the 2nd hour.
    My question is if for this kind of data analysis ninja trader has any built in function, or I have to create a strategy and use the strategy analyzer to get this kind of data?

    #2
    Hello Joaqvil,

    Thanks for your post.

    You could come up with your own custom logic in a NinjaScript strategy to calculate these values. There are no built-in methods or functions that return these specific values.

    You could use Time Comparisons or Time Filters to check if the Time is within the first hour or second hour of a trading session. The PriceSeries collection would allow you to access the Open price. The MAX() method could be used to get the highest value over a specified period. Custom logic would need to be used to calculate the values you specified.

    See the help guide documentation below for more information.

    Time Comparison: https://ninjatrader.com/support/help...imeComparisons
    Time Filter: https://ninjatrader.com/support/help...ateTimeFilters
    PriceSeries: https://ninjatrader.com/support/help...riceseries.htm
    MAX(): https://ninjatrader.com/support/help...aximum_max.htm

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    656 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    371 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X