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 aa731, Today, 02:54 AM
              0 responses
              4 views
              0 likes
              Last Post aa731
              by aa731
               
              Started by thanajo, 05-04-2021, 02:11 AM
              3 responses
              469 views
              0 likes
              Last Post tradingnasdaqprueba  
              Started by Christopher_R, Today, 12:29 AM
              0 responses
              10 views
              0 likes
              Last Post Christopher_R  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              166 responses
              2,237 views
              0 likes
              Last Post sidlercom80  
              Started by thread, Yesterday, 11:58 PM
              0 responses
              4 views
              0 likes
              Last Post thread
              by thread
               
              Working...
              X