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

Can I use 3rd party indicator in my custom indicator?

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

    Can I use 3rd party indicator in my custom indicator?

    Hi,
    I am using a 3rd party indicator that I have license for. I want some parts of the 3rd party indicator to run on bar closed and some other parts to run on each tick. I wanted to know if I can use that 3rd party indicator inside of a new custom indicator where I can set the rules for some value to appear on each tick and others on bar closed.
    Thanks

    #2
    Hello fawzanalim,

    Thank you for your post.

    Yes, logic can be separated between Calculate.OnEachTick and Calculate.OnBarClose using IsFirstTickOfBar. Please note that a hosted script will inherit the Calculate mode of the script that hosts it. If you have access to the 3rd party indicator's source code, you can take the following approach to differentiate logic between OnBarClose and OnEachTick processing.

    Please 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 on the close of a bar. You will set your host indicator to Calculate.OnEachTick and use if(IsFirstTickOfBar) and place all code that needs to calculate once every bar within that condition check. Then place all code that you want to calculate OnEachTick outside of the IsFirstTickOfBar condition check.

    SampleEnterOnceExitEveryTick -https://ninjatrader.com/support/helpGuides/nt8/?separating_logic_to_either_cal.htm

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

    Comment


      #3
      What if i dont have the access to the source code?

      Comment


        #4
        Hello fawzanalim,

        Thank you for your note.

        You do not have to have access to the source code of the indicator. You could initialize the indicator from the DLL in a new indicator script set to calculate OnEachTick followed by using an IsFirstTickOfBar check to calculate certain values OnBarClose.

        Please see the attached MyTestPlotDLL and MyDLLIndicatorTest examples for how this could be accomplished. The MyDLLIndicatorTest example initializes the indicator from MyTestPlotDLL, then prints the close price on the close of a bar and the current Low for each tick of a bar. To test this, first, import the MyTestPlotDLL into your NinjaTrader platform followed by importing the MyDLLIndicatorTest example. Open a new Chart window and NinjaScript Output window. Then, add the MyDLLIndicatorTest indicator to the chart. You will see the prints from the indicator in the NinjaScript Output window.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by kaywai, 09-01-2023, 08:44 PM
        5 responses
        601 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by xiinteractive, 04-09-2024, 08:08 AM
        6 responses
        22 views
        0 likes
        Last Post xiinteractive  
        Started by Pattontje, Yesterday, 02:10 PM
        2 responses
        18 views
        0 likes
        Last Post Pattontje  
        Started by flybuzz, 04-21-2024, 04:07 PM
        17 responses
        230 views
        0 likes
        Last Post TradingLoss  
        Started by agclub, 04-21-2024, 08:57 PM
        3 responses
        17 views
        0 likes
        Last Post TradingLoss  
        Working...
        X