Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modifying strategy-generated stops

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

    Modifying strategy-generated stops

    Hey all,

    In my strategy, I enter stop ticks and profit ticks so that each trade is bracketed and protected. Good news, my stops protect me against disasters. Bad news, my profit ticks often get me out with a profit that's a fraction of what it could have been had I let it go. (I know, greedy, greedy, greedy. )

    I watch my strategy-generated trades progress in a separate ChartTrader chart and often find myself recognizing patterns, indicator values, etc, that make me want to slide my profit target down/up a bit to give my trade more room...but then the price hits what the original target was, it stops out and I'm done. Further, sometimes, after a few seconds, the recently-moved target price just snaps back to where the strategy set it. It seems that once it's been submitted, I can't mess with it.

    Or can I? Any ideas? Are strategy-generated trades entirely different animals than ChartTrader-generated ones? I'd like to have some control over my stops once the strategy generates them, if at all possible. (Of course, I know that one of the benefits of a strategy is that it controls things for you, and the alternative would be to just trade with ChartTrader manually, but I really want the entry execution speed the strategy gives me.)

    Thanks in advance!
    Gary

    #2
    Hello hawks67,

    Officially, we do not support manually modifying any orders placed by a strategy. This is why you are not able to add a strategy to a chart that has Chart Trader open and why Chart Trader cannot be enabled on a chart when a strategy enabled.

    Your code is likely placing the order repeatedly, if you could ensure its only sent once and not modified, you could likely move it and have it stay.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks, Chelsea. As far as I know, I'm submitting an order entry that's within a bracket that checks to make sure I'm flat before doing anything. Is there anywhere else I should check to ensure that I'm not placing orders repeatedly? And if I were placing repeated orders, wouldn't I see evidence of that in the form of more execution entries in my log, not to mention greater profits/losses? Or am I misunderstanding?

      Comment


        #4
        Hello hawks67,

        If you resubmit an order to the same price with the same tag name, and this order has not filled, your submission is ignored.

        The only way to see the ignored order is to turn on TraceOrders = true; in Initialize().

        If you resubmit an order to a different price with the same tag name, this calls a change request which is sent to the broker to change the price of the existing order.


        However, when you move it, is there a PendingChange event in your log that moves it back?

        If so, thats probably that resubmission.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          My order entries have unique tags that are generated fresh each time, so I'm sure that's not what's happening. So if not, you believe I should be able to use Chart Trader in a separate chart to modify things the strategy submitted? I will look up TraceOrders and see about using that in the strategy just in case, and I'll check the log for PendingChange events.

          Thanks!

          Comment


            #6
            Hi hawks67,

            Again it is not supported to do this so I couldn't say that it will work.

            But try something simple.

            Try making a new strategy that places 1 single order in real time data.

            For example:
            in #region Variables:
            private bool orderPlaced = false;

            if (!Historical && orderPlaced == false)
            {
            EnterLongLimit(1, Low[0]-20*TickSize, "myTestOrder");
            orderPlaced = true;
            }


            This will place one limit order 20 ticks below the bar. Once this appears, move the order. Does it move back?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Well, I tried it out this morning and while it did not work as desired, I was able to identify a reasonable workaround. If my strategy establishes a live position and places stops, those stops will remain in force. I can short-circuit them by using Chart Trader and manually sliding them *closer* to the market price so they get hit first, but that's all. Moving either stop further away - even if they stay where I put them, which it looks like they will, but I didn't test it for lengthy periods - does nothing, as the original stops function as the code dictated. So I can either have the strategy put the stops at crazy distances away and then move them closer as the trade progresses (admittedly dangerous), or I can have the strategy just set a stop loss alone (and leave it), and then use Chart Trader to establish a stop limit for my profits, and move that as conditions warrant.

              So I'm good to go.

              Thanks for your help!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by trilliantrader, Today, 08:16 AM
              0 responses
              3 views
              0 likes
              Last Post trilliantrader  
              Started by AttiM, 02-14-2024, 05:20 PM
              9 responses
              174 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by funk10101, Today, 08:14 AM
              0 responses
              2 views
              0 likes
              Last Post funk10101  
              Started by adeelshahzad, Today, 03:54 AM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by RookieTrader, Today, 07:41 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X