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 sjsj2732, Yesterday, 04:31 AM
      0 responses
      22 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      280 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      279 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      130 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      90 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X