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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    56 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X