Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wrong Execution Price

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

    #16
    wrong execution of trail stop, stop loss

    That's what I've told earlier -->

    Code:
    if (BarsSinceEntry("Long Entry")>1 && Close[0] >= Position.AvgPrice + 0.0050)
    				SetTrailStop("Long Entry", CalculationMode.Ticks, 50, true);
    But Strategy Analyzer doesn't see my conditions. As you can see from print.
    Click image for larger version

Name:	StrAnalyzer.PNG
Views:	1
Size:	61.2 KB
ID:	869211

    I can't understand, why stop executes at the same bar with enter?!

    Comment


      #17
      Offtop

      Guys, is it only on my 2 different PCs that located in different places with different Internet connection?

      I can't EDIT my messages. Just empty page after click "EDIT"

      I tried on PC and laptop with Vista and Windows 7, from IE10 and Opera browsers!!!

      Comment


        #18
        Alexstox,

        Thank you for the information. We are aware of the situation regarding "Edit" and creating new threads and currently looking into it.

        The Strategy Analyzer will use the worst case scenario for the StopLoss orders that are being set.

        Are you Setting the trail stop in the Initialize() method?

        This would account for the same bar trail stop.
        Cal H.NinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_Cal View Post
          Alexstox,
          The Strategy Analyzer will use the worst case scenario for the StopLoss orders that are being set.

          Are you Setting the trail stop in the Initialize() method?
          This would account for the same bar trail stop.
          No, I set it in <protected override void OnBarUpdate()>

          Comment


            #20
            Alexstox,

            When SetTrailStop is set, it is set for the entire strategy, specifically for the signal entry name.

            You'll notice that the screenshot in post #16, that the orders in the beginning have their trail stop met later on in the chart. However, the trail stop is now set for all the orders being submitted, since the condition to have the SetTrailStop was met, it set the trail stop as a standard for all the orders.

            This is why you are getting filled on intrabar.

            You can modify the set strategy to change the price push back further

            Let me know if I can be of further assistance.
            Cal H.NinjaTrader Customer Service

            Comment


              #21
              1. As you can see I set SetTrailStop only for "Long Entry"
              2. SetTrailStop MUST work only after
              BarsSinceEntry("Long Entry")>1 && Close[0] >= Position.AvgPrice + 0.0050

              as I set it in

              if (BarsSinceEntry("Long Entry")>1 && Close[0] >= Position.AvgPrice + 0.0050)

              BUT it does not happen!

              Comment


                #22
                Alexstox,

                Once you set TrailStop once, it will always be there and for every order placed after.

                If you want to have it exit out one bar later at least you will need to calculate this manually and using an Exit Order top exit out.
                Cal H.NinjaTrader Customer Service

                Comment


                  #23
                  Originally posted by NinjaTrader_Cal View Post
                  Alexstox,

                  Once you set TrailStop once, it will always be there and for every order placed after.

                  If you want to have it exit out one bar later at least you will need to calculate this manually and using an Exit Order top exit out.
                  Dear Cal, thank you for your support. My fault was that I didn't show start of the script. So, this SetTrailStop was after IF condition for entry.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by PaulMohn, Today, 03:49 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post PaulMohn  
                  Started by inanazsocial, Today, 01:15 AM
                  1 response
                  6 views
                  0 likes
                  Last Post NinjaTrader_Jason  
                  Started by rocketman7, Today, 02:12 AM
                  0 responses
                  10 views
                  0 likes
                  Last Post rocketman7  
                  Started by dustydbayer, Today, 01:59 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post dustydbayer  
                  Started by trilliantrader, 04-18-2024, 08:16 AM
                  5 responses
                  23 views
                  0 likes
                  Last Post trilliantrader  
                  Working...
                  X