Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Weekly Pivots To Trigger Trades

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

    Using Weekly Pivots To Trigger Trades

    I want to build an intraday strategy that get's its entry signals based on weekly pivots. Let's assume I want to enter a long when the last traded price (on a 15 minute chart) first hits or exceeds the weekly pivot R1 value (the pivot being calculated on the prior weeks prices). In other words, starting Monday at 12:01 AM--whenever the last traded price hits or exceeds weekly pivot R1-I want to go long.)

    Is this the proper syntax for this?:

    if (Close[0] >= Pivots(PivotRange.Weekly, HLCCalculationMode.DailyBars, 20).R1[0])

    Do I need to add the following (prior to it)

    if(CurrentBar<XXXX)return;

    if so, what is XXXX?

    Do I need a weeks worth of 15-min bars so that the weekly pivots calculate correctly? is a week = 7x24 hours or 5 if I have weekend turned off?
    Jim-Boulder
    NinjaTrader Ecosystem Vendor - Elephant Tracks

    #2
    Hi Jim-Boulder,

    The code you have will work. You do not need a CurrentBar check, but you will need to ensure you have enough data. Since you are using a CalculationMode of Daily Bars I think you need 7 days of daily bars for the week calcs to kick in. (Don't quote me on that I haven't checked completely.) Generally if there is not enough data your Pivots will throw off values of 0 and you will know this is wrong immediately. You could just throw in an extra condition of Pivots > 0 then you won't have to worry about bogus values messing up your strategy. If the value isn't 0 you know it is a good value.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    671 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    379 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    111 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    575 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    582 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X