Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

" On Bar Close " signal on " On price Change" calculation

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

    " On Bar Close " signal on " On price Change" calculation

    HI,
    my strategy is using "On price change" calculation.
    however I need "on bar close" for some signal/indicators within the strategy . is that possible ?
    I'm using Strategy Builder.
    Thanks

    #2
    Hello Harryh007,

    Thanks for your post.

    Yes, logic can be separated between Calculate.OnPriceChange and Calculate.OnBarClose using IsFirstTickOfBar (Misc folder > IsFirstTickOfBar).

    Please note that a hosted script will inherit the Calculate mode of the script that hosts it. You can take the following approach to differentiate logic between OnBarClose and OnPriceChange processing.

    See this reference sample which demonstrates a technique used for those who need to separate their logic to calculate some values on each tick and others only at the close of a bar. This reference sample uses an unlocked script instead of the Strategy Builder but the same concept applies.

    You will set your host script to Calculate.OnPriceChange and use if(IsFirstTickOfBar) and place all code that needs to calculate once every bar within that condition Set. Then place all code that you want to calculate OnPriceChange in a separate Set outside of the IsFirstTickOfBar condition Set.

    SampleEnterOnceExitEveryTick -https://ninjatrader.com/support/help...either_cal.htm

    Please let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi Brandon,
      Thanks for reply.
      I could not find IsFirstTickOfBar on strategy builder. I could find "First bar of session"

      Comment


        #4
        Hello Harryh007,

        Thanks for your note.

        IsFirstTickOfBar could be found in the Misc folder > IsFirstTickOfBar in the Strategy Builder.

        See the attached screenshot showing where this is located.

        Note to ensure that you are updated to the latest version of NinjaTrader (8.0.26.0). Your current version of NinjaTrader could be found by going to Help > About.

        Let us know if we may further assist.
        Attached Files
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hi Brandon,
          there is none on mine. I'm using version 8.0.22.2 64-bit

          Click image for larger version

Name:	Capture.JPG
Views:	132
Size:	27.3 KB
ID:	1201737

          Comment


            #6
            Hello Harryh007,

            Thanks for your note.

            I see that you are currently using an older version of NinjaTrader. IsFirstTickOfBar is not available to use in the Strategy Builder for the version of NinjaTrader you are running.

            You would need to upgrade to the most recent version of NinjaTrader to use IsFirstTickOfBar in the Strategy Builder.

            To update NinjaTrader, please follow the steps below:
            • First, copy your license key from NinjaTrader under Help> License Key then exit NinjaTrader
            • Click on the link: https://ninjatrader.com/PlatformDirect
            • Enter your license key and press Submit
            • Select 'Download'
            • Critical: Before running the installer, ensure NinjaTrader is closed.
            Let us know if we may assist further.


            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              thanks for the guidance

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by maybeimnotrader, Today, 05:46 PM
              0 responses
              6 views
              0 likes
              Last Post maybeimnotrader  
              Started by quantismo, Today, 05:13 PM
              0 responses
              6 views
              0 likes
              Last Post quantismo  
              Started by AttiM, 02-14-2024, 05:20 PM
              8 responses
              166 views
              0 likes
              Last Post jeronymite  
              Started by cre8able, Today, 04:22 PM
              0 responses
              8 views
              0 likes
              Last Post cre8able  
              Started by RichStudent, Today, 04:21 PM
              0 responses
              5 views
              0 likes
              Last Post RichStudent  
              Working...
              X