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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      41 views
      0 likes
      Last Post CarlTrading  
      Working...
      X