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 kinfxhk, 07-14-2026, 09:39 AM
      0 responses
      13 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 10:18 AM
      0 responses
      59 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 09:50 AM
      0 responses
      42 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 07:21 AM
      0 responses
      47 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-11-2026, 02:11 AM
      0 responses
      38 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X