Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy help

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

    strategy help

    Hello,I'm working in a strategy that the rule is very simple:
    if today’s close is higher or equal to the highest close in the past 50 days, we buy tomorrow;
    I just wanted to confirm with someone if I'm on the right path using MAX indicator
    or there is another indicator out there to do the same logic,if yes wich ones??

    close(0)>=max(high,50) ,
    enter long
    Thanks in advance for any suggestions and help

    #2
    Hello janio973,

    That would be the correct way to form the condition. You can see an example of using Max here: https://ninjatrader.com/support/help...aximum_max.htm

    Code:
    double maxPrice= MAX(High, 50)[0];
    if(Close[0] >= maxPrice)
    {
        EnterLong();
    }
    This also assumes you are using a daily series, 50 BarsAgo for the lookback period would need daily bars to be 50 days. If you are using a lesser series you would need to calculate how many bars happen per day for that session and then multiply that by 50 days to get the total number of bars lookback needed.
    Last edited by NinjaTrader_Jesse; 08-03-2022, 01:08 PM.

    Comment


      #3
      NinjaTrader_Jesse thanks for your help

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X