Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

trailstop simulated

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

    trailstop simulated

    Trailstop simulated doesn't actually trail, right? It's not for me. I just downloaded the released version of V6. I will check and see if it does there. Is it supposed to? BTW, kudos on the new site. Great job!

    #2
    imported post

    oops, sorry, it does work in the newly released version Is there something I should know about simulated trail stop? Does it "hide" the order from the floor until triggered?

    Comment


      #3
      imported post

      SimStops are held on your PC and only submitted as they trigger.

      Comment


        #4
        imported post

        I wonder how much of a performance hit that is. Any idea? As far as "getting the order in"?

        Comment


          #5
          imported post

          Sorry, we don't know.

          Comment


            #6
            imported post

            Here's an issue. I'm using a 15 tick trailing stop loss. When 8 points profit reached, trailstop changes to a 2 tick stop loss. Works fine, sometimes. Sometimes I never get the 15 tick initial stop loss value. It gives me a 4 tick, or 2 tick, or even the SAME fill price as a stop loss, so it INSTANTLY gets stopped out. This happens when a trade get's stopped out, then my strategy places another limit order seconds later. Why would this be happening? I've given each trade a unique name,the trailstop is re-init'd. I can' figure out why sometimes it get's tripped up. Right now I'm usinga 30 min bar. However, it hashappened onother time frames as well.

            AMP/Zen-Fire/MarketReplay

            Comment


              #7
              imported post

              I suggest tracing the order placement logic of your strategy: http://www.ninjatrader-support.com/H...aceOrders.html

              Comment


                #8
                imported post

                Sorry, but I'm almost positive there is a bug with the SetTrailStop(). I've traced out my orders, and I took a snapshot of the trade. You'll notice, I have2 trades circled in yellow on chart. The first trade was stopped out IMMEDIATELY and should've been 15 ticks initial stop. The second I have the output showing a trailstop set to 15. I have the DOM showing the trade entered with a stoploss set at 6 ticks, should be 15. *Nothing* in my code says reset to 6 ticks. I've attached a screen capture. Sorry for the big size, but was necessary for you to see the details.

                Here's my onbarupdate code:

                protected
                overridevoid OnBarUpdate()

                {

                if (Historical){

                return;

                }



                if (Position.MarketPosition == MarketPosition.Flat){

                trailingStop =
                15;

                LookForEntries();

                }
                elseif (Position.MarketPosition != MarketPosition.Flat){



                ManageTrade();

                }

                }


                Here's code forlookforentries():

                ///
                <summary>

                /// Look For Entries

                ///</summary>

                publicvoid LookForEntries()

                {

                if (Position.MarketPosition == MarketPosition.Flat){



                // Logic removed...



                Print (
                "trail stop set to "+trailingStop);

                SetTrailStop(orderName, CalculationMode.Ticks, trailingStop,
                true);

                }




                Here's my code for managing trailing stop loss:



                ///
                <summary>

                /// Manage Trade

                ///</summary>

                publicvoid ManageTrade()

                {

                if (Position.MarketPosition != MarketPosition.Flat) {

                if (Position.GetProfitLoss(Close[0], PerformanceUnit.Points) >= TickSize*8){

                trailingStop =
                2;

                Print (
                "Setting new TrailStop for "+instrumentName+" - "+trailingStop.ToString());

                SetTrailStop(orderName, CalculationMode.Ticks, trailingStop,
                true);

                }

                }

                }


                Attached Files

                Comment


                  #9
                  imported post

                  Sorry, I'm unable to analyse what is happening here, since the scenario is way to complex (and incomplete since code is missing).

                  Let's start real simple: Please start with a simple a possible strategy to see if the SetTrailStop works as you would expect. If not, then please let us know.

                  Next amend your strategy and add complexitity step by step. Monitor your TraceOrder output and the Logs to see if it still works as you would expect until you finally isolated the cause of the trouble.

                  Comment


                    #10
                    imported post

                    Ok, it seems that

                    Position.MarketPosition does not get changed from "Flat" to "!Flat" apparently. Look at this trace output. Trade sells short, trialstop get's set to 15 next line sells short again, right? Unless I'm reading it wrong.

                    Entered internal PlaceOrder() method at 4/25/2007 1:30:00 PM: Action=SellShort OrderType=Limit Quantity=1 LimitPrice=835.8 StopPrice=0 SignalName=1S_133000' FromEntrySignal=''

                    trail stop set to 15

                    Entered internal SetStopTarget() method at 4/25/2007 1:30:00 PM: Type=TrailStop FromEntrySignal='1S_133000' Mode=Ticks Value=15 Currency=0 Simulated=True

                    Entered internal PlaceOrder() method at 4/25/2007 1:30:00 PM: Action=SellShort OrderType=Limit Quantity=1 LimitPrice=835.8 StopPrice=0 SignalName=1S_133000' FromEntrySignal=''



                    In my code below I test for MarketPosition twice, to make sure.

                    Comment


                      #11
                      imported post

                      There is no correlation between Position.MarketPosition (your actual strategy position) and the order placement (PlaceOrder or SetStopTarget).

                      The trace output you posted is not (!) the actual order fills. Please check the logs to see actual order fills and executions.


                      Comment


                        #12
                        imported post

                        Ok, another snap. This time market replay. Strategy works fine. Trades get's entered in with 15 pt trailstop. Simplified -> if5 pt profit tighten trail to 2 ticks. This does not happen. I've snapped a photo, showing log files, and the trade outlining the trade in the log files and on chart. I would like to PM you the strategy for you to look at to see if I'm missing something. I'm using a "simulated" trail stop. btw, the picture shows a 6 point profit, that's ONE beyond the 5 pt strategy, at this point the trails should be 2 ticks behind, as you can see it's still 15 or so behind.
                        Attached Files

                        Comment


                          #13
                          imported post

                          Ok, I was using a 33 tick chart *was not working*. Switched to a 3min chart, *working fine*...so, what'ya think?

                          Comment


                            #14
                            imported post

                            Man, I'm havig a major problem the this trailstop() issue. I've simplified my strat. just to see it working. Doesn't work with 33 tick chart, does work with 3 min chart. HOWEVER, on big bars, order get's filled, then get's stopped out INSTANTLY. I've given unique names, went over my logic and I can't find anything that is wrong. I can only think that the market is a bit fast, and the "order pending" issue is what's making the stop not work. According to my logic, every new trade should have an initial stop of 15 ticks. After the firsttrade, in a fast market, it seems to move to 1 tick, or SAME tick stop, without my logic. Can you take a look at my very simple script to see if you see anything wrong?

                            Comment


                              #15
                              imported post

                              Please PM me a simple as possible strategy to "dierk AT ninjatrader DOT com".

                              - this ER2?
                              - on a 33 tick series?
                              - which provider/broker? sim feed?

                              Thanks

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Aviram Y, Today, 05:29 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post Aviram Y  
                              Started by quantismo, 04-17-2024, 05:13 PM
                              3 responses
                              25 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by ScottWalsh, 04-16-2024, 04:29 PM
                              7 responses
                              34 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by cls71, Today, 04:45 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post cls71
                              by cls71
                               
                              Started by mjairg, 07-20-2023, 11:57 PM
                              3 responses
                              216 views
                              1 like
                              Last Post PaulMohn  
                              Working...
                              X