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 gyilaoliver, Today, 04:36 AM
      4 responses
      29 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by iantriestrading, Today, 10:36 AM
      2 responses
      17 views
      0 likes
      Last Post iantriestrading  
      Started by lorien, 01-15-2025, 12:10 PM
      18 responses
      418 views
      2 likes
      Last Post lorien
      by lorien
       
      Started by Danila, Yesterday, 01:34 PM
      7 responses
      38 views
      1 like
      Last Post Danila
      by Danila
       
      Started by Taddypole, Today, 10:07 AM
      0 responses
      12 views
      0 likes
      Last Post Taddypole  
      Working...
      X