Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How Do You Make a Timeframe Constant to Whatever Strategy It is Being Used in?

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

    How Do You Make a Timeframe Constant to Whatever Strategy It is Being Used in?

    I realize the title may be misleading but, allow me to explain.


    Most of strategies are trading in the minutes timeframe. However, I would like to develop an indicator that looks at the weekly and daily timeframe.

    How do I make a line like this:

    Code:
    if (CrossAbove(SMA(5), SMA(15), 1))
    look specifically at five periods on the WEEKLY chart, crossing above fifteen periods on the WEEKLY chart, even though the trade will be happening at the minutes "level,"

    Thanks in advance for any help.

    #2
    Originally posted by outstretchedarm View Post
    I realize the title may be misleading but, allow me to explain.


    Most of strategies are trading in the minutes timeframe. However, I would like to develop an indicator that looks at the weekly and daily timeframe.

    How do I make a line like this:

    Code:
    if (CrossAbove(SMA(5), SMA(15), 1))
    look specifically at five periods on the WEEKLY chart, crossing above fifteen periods on the WEEKLY chart, even though the trade will be happening at the minutes "level,"

    Thanks in advance for any help.
    Use a multi-timeframe strategy.

    Comment


      #3
      Sorry for the slow reply but, how exactly does one do that?

      Comment


        #4
        Originally posted by outstretchedarm View Post
        Sorry for the slow reply but, how exactly does one do that?
        In the strategy section of where you edit ninjascript, look at the sample:

        [Description("This is a sample multi-time frame strategy.")]
        public class SampleMultiTimeFrame : Strategy



        You'll want to add a series with Period.Type of week.

        Then uses BarsArray properly

        if (SMA(BarsArray[1], 5)[0] > SMA(BarsArray[1], 50)[0] && SMA(BarsArray[2], 5)[0] > SMA(BarsArray[2], 50)[0])

        Comment


          #5
          Ok, it'll take me a while to digest it. I have a lot to learn!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          580 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          335 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          102 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X