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

Use indicator triggers in the strategy

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

    Use indicator triggers in the strategy

    I want to start "small" might be enough for you to push me in the right direction.

    My problem is that I get several more triggers from the indicator than it supposed to give.
    Explanation:
    I have a custom indicator. If gives some triggers couple of times a day.
    I have defined a public variable array that stores the triggers. Indicator works and the print command shows exactly the time and details of the true triggers.
    Now I have created an empty strategy. The only thing it has at the moment is OnBarUpdate it waits for the trigger of the indicator and prints a message with the data. (Bar number,time etc)
    This is the bases for the strategy.
    . In the display window I see the print lines from the strategy as well as from the indicator. But I get more lines from the strategy then the indicator.
    At times of day where there are no indicator triggers.

    Where to look?

    #2
    Hello dadarara,

    I would suggest adding print statements to check whether your conditions are becoming true. I’ve provided a link to a youtube video which covers an example of using prints to understand behavior:

    Dive into manipulating C# code from within an unlocked NinjaScript strategy using the NinjaScript Editor.NinjaTrader 7 is an award winning end to end online ...


    I’ve provided a link covering debugging which you may find helpful.
    Debugging: http://ninjatrader.com/support/forum...ead.php?t=3418

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      I did all that. I have print commands in all places. That's the funny part. In the indicator I get all true triggers and I see the print lines showing that. But in the strategy print lines I get extra triggers. I hope you understand. The strategy doesn't do anything yet. It simply prints out the triggers it gets from the indicator. It looks like it prints triggers that are not received from indicator.
      Attached Files
      Last edited by dadarara; 07-25-2017, 10:46 AM.

      Comment


        #4
        Hello dadarara,

        In the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients.

        You can also contact a professional NinjaScript Consultants who would be eager to create or modify this script at your request or assist you with your script. Please let me know if you would like our business development follow up with you with a list of professional NinjaScript Consultants who would be happy to create this script or any others at your request.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by RookieTrader, Today, 09:37 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by kulwinder73, Today, 10:31 AM
        0 responses
        5 views
        0 likes
        Last Post kulwinder73  
        Started by terofs, Yesterday, 04:18 PM
        1 response
        23 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by CommonWhale, Today, 09:55 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Gerik, Today, 09:40 AM
        2 responses
        7 views
        0 likes
        Last Post Gerik
        by Gerik
         
        Working...
        X