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

Enter Filter

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

    Enter Filter

    Good afternoon.

    I enclose a Script, which desire to execute the orders of input points with a filter to limit the number of failed logins.

    1. - The case is, that market entry should have a filter to prevent many failed logins, hence the idea of putting a filter input range (filtroM) of 20 points above / below the closing cross bar (bullish / bearish).

    EnterLong (Close [0] + filtroM);
    EnterShort (Close [0] - filtroM);

    The reason that the input commands are in "Stop" is because it throws an order at a price above / below the market.

    Obviously entry should be at any post sail beam, thus closing it, is the starting point.

    Hence, the firm intends to use (but does not work):

    EnterLong Stop (int barsInProgressIndex, liveUntilCancelled bool, int Quantity, double stopPrice, string signalName);

    For the order of entry of a candle last longer (and not canceled internally by NT7)

    2. - The code attached, it works, but I need to create strategies to ensure compliance with the above.

    Could you tell me how is it done?

    A greeting.
    Attached Files

    #2
    peonia trader,

    1. I am not sure I understand this filter. There are unsupported methods to determine connection status, so you could possibly use these, count disconnections, then if there are too many disable your strategy.

    When you say "login", could you explain this?

    2. Your strategy needs to have this connection count?

    I'd be happy to comment further if you could clarify.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Enter Filter

      Hi AdamP.

      1. - Seeking how to make entries with a "filter points" above / below the price depending Long / Short.
      Thus many entries to avoid market failures.

      But not how to program them into the code and it works.

      I think that to run commands above / below the price, orders must be in "Stop"

      2. - In addition, the order should remain active until it is filled.

      Can you tell me, how I program in the system code?

      A greeting.

      Comment


        #4
        peonia trader,

        Yes, in this case you would want to use EnterLongLimit(), EnterLongStop(), EnterShortLimit() and EnterShortStop() depending on how you want to handle this.

        These reference samples may help you.

        Trading a breakout : http://www.ninjatrader.com/support/f...ead.php?t=3223

        Monitoring multiple orders : http://www.ninjatrader.com/support/f...ead.php?t=3225

        Using CancelOrder to cancel Stop/Limit orders : http://www.ninjatrader.com/support/f...ad.php?t=18890

        You can use the following : http://www.ninjatrader.com/support/h...imeinforce.htm to have an order remain active until its closed.

        Please let me know if I may assist further.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Exit with filter points

          I enclose a system that:
          - The entry is long on "Stop" when a bullish crossover filter is reached "filtroM".
          - Has a target profit "profitL".
          - And out of the market "ExitLong ();" when a bearish cross.

          I intend the system to perform:
          1. - To exit the market, the reverse of the form that has entered, ie, when a crossbelow and the output occurs in: "Close [0] - filtroM".
          with the same filter for the inputs Long, but in reverse.

          2. - For the output produced in "Close [0] - filtroM" also need the output the order remains active over a candle.
          Thanks for the help.
          Attached Files

          Comment


            #6
            peonia,

            Do you have any questions about this or are you posting your work to show?

            I'd be happy to answer questions where I am able.
            Adam P.NinjaTrader Customer Service

            Comment


              #7
              Exit with filter points

              Hi AdamP.

              Yes, indeed, my questions are 1 and 2 points above.
              But I do not know what function to use, if I use an ExitLong "Stop" order.
              The Output Window tells me that the orders are canceled each other.
              Then, what functions should I use?

              Thanks

              Comment


                #8
                peonia,

                You can use limit or stop orders here depending on how you want to handle it.

                As far as cancelling pending limit or stop orders, you can use the following : http://www.ninjatrader.com/support/h...ancelorder.htm

                You can check if you are in a position using : http://www.ninjatrader.com/support/h...etposition.htm

                Using this way to check your position, you can then use the ExitLong() or ExitShort() commands. They key is to know you have a position first as a limit order may be a pending order until its filled.

                Please let me know if I may assist further.
                Adam P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Mindset, 05-06-2023, 09:03 PM
                9 responses
                258 views
                0 likes
                Last Post ender_wiggum  
                Started by Mizzouman1, Today, 07:35 AM
                4 responses
                18 views
                0 likes
                Last Post Mizzouman1  
                Started by philmg, Today, 01:17 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_ChristopherJ  
                Started by cre8able, Today, 01:01 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by manitshah915, Today, 12:59 PM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Erick  
                Working...
                X