Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Creating my own pivots

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

    Creating my own pivots

    hello,
    old time user here, I have made a copy of "Pivots" Indicator I am wanting to Create my own pivots basing the closing candle to define my pivot to be the 3:15pm candle Chicago time.

    I believe this code will define my closing candle

    protected override void OnbarUpdate()

    if (CurrentBar < 1) return;

    if (ToTime(Time[0]) == ToTime(new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 4, 15, 0)))
    {
    // 4:15 AM candle closing price
    double closingPrice = Close[0];

    how do input this to configure my new closing position if it is possible?

    thankyou for your time reading this


    #2
    Hello Christopher Leggit,

    Thanks for your post.

    A simple Time Comparison condition could be used to check if the Time is 4:15AM.

    This help guide page details how to set up Time Comparison conditions in a NinjaScript: https://ninjatrader.com/support/help...on_builder.htm

    You could use the Strategy Builder to set up a Time Comparison condition and then click the 'View code' button to see the generated code and apply that logic to your custom script.

    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Thankyou Brandon

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      571 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      331 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      549 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      550 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X