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

How to make purchases and sales at the close of the bar and update the stop in ticks

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

    #76
    Hello jmarcano,

    Thank you for your reply.

    This print does not indicate an order was placed, just that the internal SetStopTarget() method was updated.

    10/19/2020 12:38:00 PM Strategy '/203086409': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=46 IsSimulatedStop=False IsMarketIfTouched=False

    I'm not seeing a print showing that an order was placed there, nor do I see an order at 12:38 pm on your chart in the screenshot you've provided.

    Do you see anything in the log tab of the control center indicating an order was placed at that time?

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #77
      Hello Kate, Excuse me, I sent you the wrong trace, this is the correct one, it is at 12:18, it marks an entry but in the chart it does not run


      10/19/2020 12:18:00 PM Strategy 'BreakOutV01/203089332': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=46 IsSimulatedStop=False IsMarketIfTouched=False

      10/19/2020 12:18:00 PM Times[0][0].TimeOfDay: 12:18:00 => Apertura.TimeOfDay: 09:35:00: True

      10/19/2020 12:18:00 PM Times[0][0].TimeOfDay: 12:18:00 < Cierre.TimeOfDay: 15:30:00: True

      10/19/2020 12:18:00 PM Position.MarketPosition: Flat == MarketPosition.Flat: Flat: True

      10/19/2020 12:18:00 PM VolumeUpDown1.UpVolume[0]: 0 > 1300: False

      10/19/2020 12:18:00 PM Close[1]: 11770.25 < Swing1.SwingHigh[1]: 11807.75 && Close[0]: 11766.5 > Swing1.SwingHigh[0]: 11807.75: False

      10/19/2020 12:18:00 PM Close[0]: 11766.5 > EMA1[0]: 11788.2045827647: False

      10/19/2020 12:18:00 PM Operaciones: 3 < TradeDay: 10: True

      10/19/2020 12:18:00 PM Long: True == true: True

      10/19/2020 12:18:00 PM Times[0][0].TimeOfDay: 12:18:00 => Apertura.TimeOfDay: 09:35:00: True

      10/19/2020 12:18:00 PM Times[0][0].TimeOfDay: 12:18:00 < Cierre.TimeOfDay: 15:30:00: True

      10/19/2020 12:18:00 PM Position.MarketPosition: Flat == MarketPosition.Flat: Flat: True

      10/19/2020 12:18:00 PM VolumeUpDown1.DownVolume[0]: 2702 > 1300: True

      10/19/2020 12:18:00 PM Close[1]: 11770.25 > Swing1.SwingHigh[1]: 11807.75 && Close[0]: 11766.5 < Swing1.SwingHigh[0]: 11807.75: False

      10/19/2020 12:18:00 PM Close[0]: 11766.5 < EMA1[0]: 11788.2045827647: True

      10/19/2020 12:18:00 PM Operaciones: 3 < TradeDay: 10: True

      10/19/2020 12:18:00 PM Long: True == true: True
      10/19/2020 12:18:00 PM Strategy 'BreakOutV01/203089332': Entered internal SubmitOrderManaged() method at 10/19/2020 12:18:00 PM: BarsInProgress=0 Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='@Sell' FromEntrySignal=''
      10/19/2020 12:18:00 PM Condition true
      10/19/2020 12:18:00 PM Strategy 'BreakOutV01/203089332: Cancelled pending exit order, since associated position is closed, orderId='NT-00077-55' account='Sim101' name='Profit target' orderState=Working instrument='NQ 12-20' orderAction=BuyToCover orderType='Limit' limitPrice=11742.75 stopPrice=0 quantity=1 tif=Day oco='NT-00050-55' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-10-19 12:18:00' gtd='2099-12-01' statementDate='2020-10-19'
      10/19/2020 12:18:00 PM Strategy 'BreakOutV01/203089332': Cancelled OCO paired order: BarsInProgress=0, orderId='NT-00077-55' account='Sim101' name='Profit target' orderState=Cancelled instrument='NQ 12-20' orderAction=BuyToCover orderType='Limit' limitPrice=11742.75 stopPrice=0 quantity=1 tif=Day oco='NT-00050-55' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-10-19 12:18:00' gtd='2099-12-01' statementDate='2020-10-19'
      10/19/2020 12:20:00 PM Strategy 'BreakOutV01/203089332': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=46 IsSimulatedStop=False IsMarketIfTouched=False

      10/19/2020 12:20:00 PM Times[0][0].TimeOfDay: 12:20:00 => Apertura.TimeOfDay: 09:35:00: True

      10/19/2020 12:20:00 PM Times[0][0].TimeOfDay: 12:20:00 < Cierre.TimeOfDay: 15:30:00: True

      10/19/2020 12:20:00 PM Position.MarketPosition: Flat == MarketPosition.Flat: Flat: True

      10/19/2020 12:20:00 PM VolumeUpDown1.UpVolume[0]: 0 > 1300: False

      10/19/2020 12:20:00 PM Close[1]: 11766.5 < Swing1.SwingHigh[1]: 11807.75 && Close[0]: 11764.5 > Swing1.SwingHigh[0]: 11807.75: False

      10/19/2020 12:20:00 PM Close[0]: 11764.5 > EMA1[0]: 11785.9470034538: False

      10/19/2020 12:20:00 PM Operaciones: 4 < TradeDay: 10: True

      10/19/2020 12:20:00 PM Long: True == true: True

      10/19/2020 12:20:00 PM Times[0][0].TimeOfDay: 12:20:00 => Apertura.TimeOfDay: 09:35:00: True

      10/19/2020 12:20:00 PM Times[0][0].TimeOfDay: 12:20:00 < Cierre.TimeOfDay: 15:30:00: True

      10/19/2020 12:20:00 PM Position.MarketPosition: Flat == MarketPosition.Flat: Flat: True

      10/19/2020 12:20:00 PM VolumeUpDown1.DownVolume[0]: 1895 > 1300: True

      10/19/2020 12:20:00 PM Close[1]: 11766.5 > Swing1.SwingHigh[1]: 11807.75 && Close[0]: 11764.5 < Swing1.SwingHigh[0]: 11807.75: False

      10/19/2020 12:20:00 PM Close[0]: 11764.5 < EMA1[0]: 11785.9470034538: True

      10/19/2020 12:20:00 PM Operaciones: 4 < TradeDay: 10: True

      10/19/2020 12:20:00 PM Long: True == true: True

      Comment


        #78
        Good afternoon Kate, I send you a video made in play back where I should make an entry and does not make it and then it marks me as if I made it

        Comment


          #79

          Good afternoon Kate, did you see my message?

          Thank You

          Comment


            #80
            Hello jmarcano,

            Thank you for your reply.

            I've been unable to access the linked video, however, the prints seem to show that the order is being placed but is immediately closing. Could you ensure the linked video is visible to others? You may want to try uploading it as a non-public video on something like Youtube where you can still share it with a link, sometimes Google Drive can be a bit tricky to share videos.

            Thanks in advance; I look forward to assisting you further.
            Kate W.NinjaTrader Customer Service

            Comment


              #81

              good afternoon kate, try again


              Comment


                #82
                Kate, Do you need me to send you the code to validate it?

                Thanks for you support

                Comment


                  #83

                  kate access by youtube

                  Comment


                    #84
                    Hello jmarcano,

                    Thank you for your reply.

                    Yes, we would like to test on our end with the strategy code as you currently have it. You can export the strategy from Tools > Export > NinjaScript Add-on. Do not check the box to export as a compiled assembly or we will not be able to review the code. Please attach the resulting .Zip file to your reply.

                    We will also need exact instructions for testing. This is occurring in Playback, is that correct? We'll need to know the time zone you're in, the instrument this occurs on (from your video, it appears to be NQ 12-20, is that correct?), and the chart interval and bar type (for example, 1 minute, 4 renko, etc).

                    Thanks in advance; I look forward to assisting you further.
                    Kate W.NinjaTrader Customer Service

                    Comment


                      #85
                      hello kate.
                      Send my code, Thanks for your help.
                      Attached Files

                      Comment


                        #86
                        Hello jmarcano,

                        Thank you for your reply.

                        I did not receive answers to the questions in my previous post. I'm including those below:

                        We will also need exact instructions for testing. This is occurring in Playback, is that correct? We'll need to know the time zone you're in, the instrument this occurs on (from your video, it appears to be NQ 12-20, is that correct?), and the chart interval and bar type (for example, 1 minute, 4 renko, etc).
                        Thanks in advance; I look forward to assisting you further.
                        Kate W.NinjaTrader Customer Service

                        Comment


                          #87
                          ok I am sorry.

                          Is on NQ 12-20. Candels and 2min intervals.

                          thank you.

                          Comment


                            #88
                            Hello jmarcano,

                            Thank you for your reply.

                            I'm not able to duplicate this so far on my end. Could you provide screen shots of the Data Series window of your chart, and the Strategy Parameters you have set for the strategy?

                            To send a screenshot with Windows 7 or newer I would recommend using the Windows Snipping Tool.

                            Click here for instructions

                            Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

                            Click here for detailed instruction

                            Also, you did not let me know what time zone you are located in so we can be sure we're looking at the correct bars. What time zone are you located in?

                            Thanks in advance; I look forward to assisting you further.
                            Kate W.NinjaTrader Customer Service

                            Comment


                              #89
                              Hello kate, good afternoon, I send you the requested print, I am locate in Miami.

                              The input parameters are:

                              Long.

                              If the closing of the candle ends above swing and with a volume greater than 1300 and above the ema1, make a purchase and must carry out the breakeven movement when it reaches a number of ticks.

                              Short.

                              If the closing of the candle ends below swing and with a volume greater than 1300 and below the ema1, it makes a sale and must carry out the breakeven movement when it reaches a number of ticks.

                              the purchase or sale to the market must be done at the close of the bar and the balance movement in ticks.

                              Thank you for the support
                              Attached Files

                              Comment


                                #90
                                Hello jmarcano,

                                Thank you for your reply.

                                Those settings in your screenshots do not appear to match the prints in your video using Playback, which is what we are attempting to replicate - those prints indicate that at least the Cierre time and the TradeDay setting were different. Can you confirm what settings you were using in Playback? Further, I did not receive a screenshot of the Data Series window to see your chart settings, only a screenshot of the chart itself. The Data Series window can be reached by right clicking on the chart and selecting "Data Series". I will need to see a screenshot of how you had this set up for your playback tests as well.

                                Thanks in advance; I look forward to assisting you further.
                                Kate W.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Graci117, Today, 09:02 PM
                                0 responses
                                2 views
                                0 likes
                                Last Post Graci117  
                                Started by ETFVoyageur, Today, 07:55 PM
                                0 responses
                                6 views
                                0 likes
                                Last Post ETFVoyageur  
                                Started by janio973, Today, 07:24 PM
                                1 response
                                7 views
                                0 likes
                                Last Post NinjaTrader_Manfred  
                                Started by aligator, 01-06-2022, 12:14 PM
                                4 responses
                                242 views
                                0 likes
                                Last Post john_44573  
                                Started by reynoldsn, Today, 05:56 PM
                                0 responses
                                14 views
                                0 likes
                                Last Post reynoldsn  
                                Working...
                                X