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, 05-11-2026, 05:56 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      32 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      195 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      356 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      277 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X