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 athexinehowley, Today, 02:39 AM
      0 responses
      4 views
      0 likes
      Last Post athexinehowley  
      Started by dtaylor, Today, 02:24 AM
      0 responses
      4 views
      0 likes
      Last Post dtaylor
      by dtaylor
       
      Started by RosaRichardow, Today, 12:21 AM
      1 response
      5 views
      0 likes
      Last Post marcus2300  
      Started by ETFVoyageur, Today, 12:45 AM
      1 response
      8 views
      0 likes
      Last Post ETFVoyageur  
      Started by TradeSaber, Yesterday, 10:33 PM
      1 response
      13 views
      0 likes
      Last Post TradeSaber  
      Working...
      X