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

a little trouble whit my strategy

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

    #16
    hello good evening Kate W. a pleasure to greet you, thanking you in advance for your contribution, next I upload the log of the detail mentioned above, but this time with the live account and under the parameters that you indicated me (.bystrategyPosition), I would like if everything went as it should ( with 2 quantity in the execution and if their outputs in this case was also the same with the 2) thank you very much
    Hello simonerg,

    Thank you for your reply.

    Here's what I see in your logs having occurred (Please note I've removed your account number and replaced it with "MYACCOUNT" for privacy reasons):

    2020-08-07 00:02:35:284|1|32|Order='403cd64bd94a484381fa34032 c6fd548/' Name='compra' New state='Submitted' Instrument='MNQ 09-20' Action='Buy' Limit price=0 Stop price=0 Quantity=2 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:02:35:494|1|32|Order='1288001671/MYACCOUNT' Name='compra' New state='Accepted' Instrument='MNQ 09-20' Action='Buy' Limit price=0 Stop price=0 Quantity=2 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:02:35:494|1|32|Order='1288001671/MYACCOUNT' Name='compra' New state='Working' Instrument='MNQ 09-20' Action='Buy' Limit price=0 Stop price=0 Quantity=2 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:02:35:568|1|32|Order='1288001671/MYACCOUNT' Name='compra' New state='Filled' Instrument='MNQ 09-20' Action='Buy' Limit price=0 Stop price=0 Quantity=2 Type='Market' Time in force=GTC Oco='' Filled=2 Fill price=11185 Error='No error' Native error=''
    2020-08-07 00:02:35:582|1|8|Execution='334226438925' Instrument='MNQ 09-20' Account='' Exchange=Globex Price=11185 Quantity=2 Market position=Long Operation=Operation_Add Order='1288001671' Time='8/7/2020 12:02 AM'

    First, your initial order for 2 long gets filled.

    2020-08-07 00:02:35:599|1|16|NinjaScript strategy 'ContadorVelas/207918217' submitting order
    2020-08-07 00:02:35:599|1|16|NinjaScript strategy 'ContadorVelas/207918217' submitting order
    2020-08-07 00:02:35:603|1|32|Order='0c746d0331cb4cc589bd52b20 65280d2/MYACCOUNT' Name='CStop' New state='Submitted' Instrument='MNQ 09-20' Action='Sell' Limit price=0 Stop price=11179.75 Quantity=2 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:02:35:605|1|32|Order='ccb46368d2ad48b7b12ea2ea1 68c2767/MYACCOUNT' Name='CTarget' New state='Submitted' Instrument='MNQ 09-20' Action='Sell' Limit price=11195.5 Stop price=0 Quantity=2 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:02:35:664|1|32|Order='1288020395/MYACCOUNT' Name='CStop' New state='Accepted' Instrument='MNQ 09-20' Action='Sell' Limit price=0 Stop price=11179.75 Quantity=2 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:02:35:664|1|32|Order='1288020395/MYACCOUNT' Name='CStop' New state='Working' Instrument='MNQ 09-20' Action='Sell' Limit price=0 Stop price=11179.75 Quantity=2 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:02:35:672|1|64|Instrument='MNQ 09-20' Account='' Average price=11185 Quantity=2 Market position=Long Operation=Operation_Add
    2020-08-07 00:02:35:712|1|32|Order='1288001672/MYACCOUNT' Name='CTarget' New state='Accepted' Instrument='MNQ 09-20' Action='Sell' Limit price=11195.5 Stop price=0 Quantity=2 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:02:35:712|1|32|Order='1288001672/MYACCOUNT' Name='CTarget' New state='Working' Instrument='MNQ 09-20' Action='Sell' Limit price=11195.5 Stop price=0 Quantity=2 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''

    A Stop loss and profit target get submitted and are in a working state.

    2020-08-07 00:02:47:682|1|16|NinjaScript strategy 'ContadorVelas/207918217' submitting order
    2020-08-07 00:02:47:687|1|32|Order='c1d7f6f463aa49e288ea1e410 ec83657/MYACCOUNT' Name='BreakCompra' New state='Submitted' Instrument='MNQ 09-20' Action='Sell' Limit price=0 Stop price=11185 Quantity=2 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:02:47:748|1|32|Order='1287987378/MYACCOUNT' Name='BreakCompra' New state='Accepted' Instrument='MNQ 09-20' Action='Sell' Limit price=0 Stop price=11185 Quantity=2 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:02:47:748|1|32|Order='1287987378/MYACCOUNT' Name='BreakCompra' New state='Working' Instrument='MNQ 09-20' Action='Sell' Limit price=0 Stop price=11185 Quantity=2 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''

    A second entry order, this time a sell order is placed for 2 at 11185, however:

    2020-08-07 00:13:18:568|1|32|Order='1288001672/MYACCOUNT' Name='CTarget' New state='Filled' Instrument='MNQ 09-20' Action='Sell' Limit price=11195.5 Stop price=0 Quantity=2 Type='Limit' Time in force=GTC Oco='' Filled=2 Fill price=11195.5 Error='No error' Native error=''

    The first target fills at 11195.50 and the BreakCompra order as well as the remaining stop loss get cancelled.

    2020-08-07 00:13:18:568|1|8|Execution='334227995149' Instrument='MNQ 09-20' Account='MYACCOUNT' Exchange=Globex Price=11195.5 Quantity=2 Market position=Short Operation=Operation_Add Order='1288001672' Time='8/7/2020 12:13 AM'
    2020-08-07 00:13:18:585|1|32|Order='1287987378/MYACCOUNT' Name='BreakCompra' New state='Cancel submitted' Instrument='MNQ 09-20' Action='Sell' Limit price=0 Stop price=11185 Quantity=2 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:13:18:587|1|32|Order='1288020395/MYACCOUNT' Name='CStop' New state='Cancel submitted' Instrument='MNQ 09-20' Action='Sell' Limit price=0 Stop price=11179.75 Quantity=2 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:13:18:642|1|64|Instrument='MNQ 09-20' Account='' Average price=0 Quantity=0 Market position=Short Operation=Remove
    2020-08-07 00:13:18:649|1|32|Order='1287987378/MYACCOUNT' Name='BreakCompra' New state='Cancelled' Instrument='MNQ 09-20' Action='Sell' Limit price=0 Stop price=11185 Quantity=2 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-07 00:13:18:650|1|32|Order='1288020395/MYACCOUNT' Name='CStop' New state='Cancelled' Instrument='MNQ 09-20' Action='Sell' Limit price=0 Stop price=11179.75 Quantity=2 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''

    I'd like to take a look at your strategy as generally speaking, I would expect the second entry to have been ignored under the usual order handling rules, specifically this one:

    A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction

    If you can supply a reduced version of the strategy that can replicate this that would be helpful. You can either attach it to your reply here or send it to us directly if you're not comfortable with posting that publicly at platformsupport [at] ninjatrader [dot] com. If you go the email route, please put 2581597 ATTN Kate W. in the subject line and a link to this post in the body of the email.

    Thanks in advance; I look forward to assisting you further.

    Kate W.NinjaTrader Customer Service

    Comment


      #17
      Hello Kate, nice to greet you again, if you take a look at post # 11 and # 12 of this topic we were looking for a solution to that Log, this one that I sent you again is how the confirmation of the changes that you suggested will change so that it will work , this NEW Log, I send it to you to confirm already in real time in real time that IT WORKS and confirm to give the go-ahead.

      PS: the strategy works as follows depending on a measure in a movement he takes a certain amount of Quantity ....

      thanks in advance waiting

      Comment


        #18
        Hello simonerg,

        Thank you for your reply.

        I apologize for my delayed reply as our forum was down due to technical difficulties for a few days.

        The above was from the log you supplied in Post #15, not the previously posted one. If the log that was in post #15 (which we removed as it contains personal information) is from the current version of the strategy, we would want to take a look at the strategy to look more closely at why the second order was not ignored - it may be due to entries per direction settings, but we'd want to test that on our end. However, if it appears to be working how you wish, you could simply move forward with the current strategy.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #19
          hi Kate, very gratefuly in this operation the bot when I take the entry of 2 contracts did not have partial filling

          because she took both contracts at the same time

          The question is, if I had taken 1 contract at one price and another at a different price, for a total of 2. With the current configuration that the bot has, the stop and target orders would be placed with 2 contracts?

          PD: current parameter .ByStrategyPosition.

          Comment


            #20
            Hello simonerg,

            Thank you for your reply.

            I no longer have your original log file available. However, if you have the strategy set to allow two entries (Entries Per Direction is set to 2) it should allow you to take two entries in the same direction at the same time without error or ignoring an error.

            Please let us know if we may be of further assistance to you.
            Kate W.NinjaTrader Customer Service

            Comment


              #21
              hi kate look at this:
              hi partners of this forum, im glad for write, in this oportunity i have a trouble that is : When we do the tests in the backtesting, all the operations carried out, purchases or sales, that use multiple contracts, configure your stop and your target with the number of contracts that were placed at the time of starting the

              hi partners of this forum, im glad for write, in this oportunity i have a trouble that is : When we do the tests in the backtesting, all the operations carried out, purchases or sales, that use multiple contracts, configure your stop and your target with the number of contracts that were placed at the time of starting the


              You suggested to me in those threads to apply the .BysStrategyPosition in the operations ... according to the LOG that is published and explained by you in this SAME POST by you, now the recent LOG is for you to confirm that IT IS WELL DONE ACCORDING TO THE PARAMETERS YOU GAVE ME

              Comment


                #22
                Hello simonerg,

                Please do not post any personal information on the forums including the log and trace files, your account number, phone number, email, or any other personal information.

                To send personal information to our staff, send an email to platformsupport [at] ninjatrader [dot] com.

                That said, are you finding the stop and target when using StopTargetHandling.ByStrategyPosition are you finding that the stop order quantity is not updating after part fills?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #23
                  Hello Kate, your previous answer generated another question for me, look at the last LOG, entered with 2 quantities at the same time and price, as we know it was a matter of the market movement, the question that this has generated me is that if: when it enters different prices, it will perform the complete filling of the stop and the target in its equivalent?, since the strategy according to four parameters increases the quantity

                  PD:The strategy changes its quantity according to certain parameters, so I need the average full fillings for both estop and target, and you had explained to me that I needed to configure the parameter .ByStrategyPosition

                  Comment


                    #24
                    sorry Hi Chelsea i dont see was uthat answer me

                    Comment


                      #25
                      hi again The main question I have is this, if I take a long position with 2 contracts at different prices each one (1 contact at 10500.00 and the other one at 10500.25) the stop and target orders are going to be placed with 2 contracts? I have this question because in the past I had this problem, we spoke about it and you gave a solution which I set in my strategy, and now I want to make sure if I did it well. This time the strategy worked well, took a long position with 2 contracts at the same price, and placed the stop and target orders with 2 contracts as well, but if It had taken a long position with 2 contracts at different prices, does the strategy is configured to place the stop and targets orders with 2 contacts as well?

                      Pd: my strategy works with 1, 2 or 3 contracts.

                      Comment


                        #26
                        Hello simonerg,

                        Thank you for your reply.

                        The latest log did not show two orders being filled at different prices, so we cannot confirm that. If you'd like to supply the strategy as you have it now, we could test on our end. However, the previous log does show all strategy protective orders being set for the correct quantity.

                        Please let us know if we may be of further assistance to you.
                        Kate W.NinjaTrader Customer Service

                        Comment


                          #27
                          hi send the strategy to u window chat

                          Comment


                            #28
                            Hello simonerg,

                            Thank you for your reply.

                            Our platform support does not communicate through private messages on the forum as we do not often check these and we would not be able to reply in a timely manner. Our team is also not able to collaborate with private forum messages. To send a strategy, please either attach it to a post, or if you prefer, send it directly to us via platformsupport [at] ninjatrader [dot] com. If you email it, please put "2581597 ATTN Kate W." in the subject line of the email as well as a link to this post in the body of the email.

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

                            Comment


                              #29
                              hi i send the requeriments yesterday thanks

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by aa731, Today, 02:54 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post aa731
                              by aa731
                               
                              Started by thanajo, 05-04-2021, 02:11 AM
                              3 responses
                              470 views
                              0 likes
                              Last Post tradingnasdaqprueba  
                              Started by Christopher_R, Today, 12:29 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post Christopher_R  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              166 responses
                              2,237 views
                              0 likes
                              Last Post sidlercom80  
                              Started by thread, Yesterday, 11:58 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post thread
                              by thread
                               
                              Working...
                              X