Announcement

Collapse
No announcement yet.

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 forrestang, Yesterday, 02:18 PM
        1 response
        23 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by bdelorm, Yesterday, 11:13 AM
        1 response
        38 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by markyb0y, Yesterday, 10:04 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by pjptrading, Yesterday, 08:17 AM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by robertparlsa, Today, 12:03 AM
        0 responses
        5 views
        0 likes
        Last Post robertparlsa  
        Working...
        X