Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.

    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thankyou Brandon

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cre8able, Yesterday, 01:16 PM
      3 responses
      11 views
      0 likes
      Last Post cre8able  
      Started by ChartTourist, Today, 08:22 AM
      0 responses
      6 views
      0 likes
      Last Post ChartTourist  
      Started by LiamTwine, Today, 08:10 AM
      0 responses
      2 views
      0 likes
      Last Post LiamTwine  
      Started by Balage0922, Today, 07:38 AM
      0 responses
      5 views
      0 likes
      Last Post Balage0922  
      Started by JoMoon2024, Today, 06:56 AM
      0 responses
      6 views
      0 likes
      Last Post JoMoon2024  
      Working...
      X