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

Combination Charttrader and Ninja-script stops

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

    Combination Charttrader and Ninja-script stops

    Today I attended the chart trader seminar and there I didn't really get an answer about the following question:

    I would like to perform semi-automated trades...

    that means, I would like to enter (open) trades via the chart trader but the stop should going to be a self-coded Ninja-Script stop strategy.

    In the webinar I was told, when I want to use Ninja-script I have to switch off the chart trader!!!??

    so... is it anyhow possible to perform a combination of manual entered trades and self-coded stops?

    many thanks for your help

    #2
    >> but the stop should going to be a self-coded Ninja-Script stop strategy
    Unfortunately this is not supported, since a NS strategy only can manage order/position triggered/entered by itself.

    Comment


      #3
      Combination Charttrader and Ninja-script stops

      ooops.... does that mean, that it is also not possible to use ... for example ... an indicator like a Parabolic SAR, or a Bollinger band or what ever as a trailing stop when the charttrader is activated??

      Comment


        #4
        Sorry, I'm confused. Is this about indicators (no problem there) or about NinjaScript strategies where you can not exit a position entered manually e.g. by chart trader?

        Comment


          #5
          What I want to achieve, that after I get a signal based on a certain chart constellation, I want to manually place an order (stop- or market ) into the chart.

          As soon as the order gets filled, the system - in form of an indicator, strategy or what ever - should take control about the trade.

          So if you can show me the way how I can use - in combination with the chart trader - an indicator (common or self coded) as a automated stop-strategy, I would be absolutely happy.

          many thanks for your help

          Comment


            #6
            Indicators can't manage orders/positions only strategies can -> unfortunately what you wanted to achieve is not supported

            Comment


              #7
              Dierk,

              If a position is opened manually by an ATM order, can't a strategy be created with utilizes the GetAtmStrategyMarketPosition() function, and then use some logic from within to close such an order?
              mrlogik
              NinjaTrader Ecosystem Vendor - Purelogik Trading

              Comment


                #8
                Originally posted by mrlogik View Post
                Dierk,

                If a position is opened manually by an ATM order, can't a strategy be created with utilizes the GetAtmStrategyMarketPosition() function, and then use some logic from within to close such an order?
                This is not possible since you need to have a id reference to the ATM strategy. You can only provide a id reference by programatically spawning an ATM strategy.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  OK ... I think I have to accept, that it is not possible to combine the chart trader with Ninja-Script strategies....

                  let's try with a fully automated system ....

                  ... is it on the other hand possible to press all my signals into a strategy and whenever a signal occurs I get decision-popup (yes-no decision) where I can decide to perform the order or not

                  Comment


                    #10
                    Order confirmation for strategies are currently not supported.
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      If you're using MBT then yes, you can finagle it a littl bit.

                      You can set the MBT confirmation quantity threshold below however many lots your order consists of, this way the MBT order confirmation window comes up and to confirm that you want to allow the order to be processed.
                      mrlogik
                      NinjaTrader Ecosystem Vendor - Purelogik Trading

                      Comment


                        #12
                        Originally posted by mrlogik View Post
                        If you're using MBT then yes, you can finagle it a littl bit.

                        You can set the MBT confirmation quantity threshold below however many lots your order consists of, this way the MBT order confirmation window comes up and to confirm that you want to allow the order to be processed.
                        OK guys ... here I found a solution to confirm orders in a Ninja Script strategy:

                        quantity = orderHandler.GetQuantity(Instrument);

                        ....
                        ....
                        using System.Windows.Forms;
                        ......
                        ......


                        if ( positionCounter != 0)
                        quantity = (int)Math.Round(quantity / (double)Math.Abs (positionCounter), 0, MidpointRounding.AwayFromZero);
                        int isLong = (int)myBollBandReversal.GetIsLong();


                        direction = isLong == 1 ? "Long" : "Short";


                        DialogResult dialogResult = MessageBox.Show(Instrument.FullName + ": " + strategyName + direction + "-Order ausführen?", "Achtung", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                        if ( dialogResult == DialogResult.Yes ){

                        if ( isLong == 1 ) {
                        pendingOrder = OpenLongOrder(quantity, entryPrice, pendingOrder, strategyName);



                        that means, whenever I get a signal, a messagebox appears, where I can select wheter I want to perform the order or not.

                        ... as easy as that ...

                        Comment


                          #13
                          Well, it's not that simple (and that's why it's not supported). Here are some hints (but not getting into deeper discussions on windows concepts):
                          - a modal dialog will block your app. Not sure if you could afford that
                          - NT7 will come with multi-threading on NinjaScript objects. It no longer is guaranteed that your code would be executed in the app's main thread -> any UI related code could fail and even crash the app (see windows API docs for details)

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Sparkyboy, Today, 10:57 AM
                          0 responses
                          1 view
                          0 likes
                          Last Post Sparkyboy  
                          Started by TheMarlin801, 10-13-2020, 01:40 AM
                          21 responses
                          3,916 views
                          0 likes
                          Last Post Bidder
                          by Bidder
                           
                          Started by timmbbo, 07-05-2023, 10:21 PM
                          3 responses
                          152 views
                          0 likes
                          Last Post grayfrog  
                          Started by Lumbeezl, 01-11-2022, 06:50 PM
                          30 responses
                          809 views
                          1 like
                          Last Post grayfrog  
                          Started by xiinteractive, 04-09-2024, 08:08 AM
                          3 responses
                          11 views
                          0 likes
                          Last Post NinjaTrader_Erick  
                          Working...
                          X