Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Week 3 of attempting to Count my Open Positions

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

    #16
    Hello Andrew,
    The Positions[BarsInProgress].MarketPosition == MarketPosition.Long) code is supposed to check for the current market position.

    If you use the Print function then what print outs are you getting.

    Code:
    Print(Positions[BarsInProgress].MarketPosition.ToString);
    JoydeepNinjaTrader Customer Service

    Comment


      #17
      I am getting no executions and no Print statements about Market Position.

      Please see attached toy code. only bar #2 is being invoked.
      Attached Files

      Comment


        #18
        Hello Andrew,
        If I try the below code I can get the Prints in the OnExecution event.
        Attached Files
        JoydeepNinjaTrader Customer Service

        Comment


          #19
          I will review this but my other concern is that you were not seeing Print Statements on Executions, but only null Execution/Order Status, yes?

          This worries me.

          I will review and return with my results tomorrow.

          Comment


            #20
            My observations came much faster than I had expected; the on Execution method seems very intuitive, but I am concerned that some of the syntax is not allowing the OnBarUpdate to work-- it will neither print nor send an order for me.


            Something seems to be wrong with the way in which the array of bars is being used to call the OnBarUpdate. This strategy is meant to execute frequently for testing purposes and I have not seen an execution all day.

            Joydeep, can you please confirm this is also the case in the file that you posted for me?

            Thank you,

            Andrew

            Comment


              #21
              Joydeep did you have time to check the code you proposed as I did?

              Executions are not occuring and they are set up to be near constant.

              Wondering if you are finding same.

              Rgeards,

              Andrew

              Comment


                #22
                Hello Andrew,
                For testing purpose I have changed the data series to Minute bars. Is that the reason the strategy is not executing as per your desired.

                Please make sure to set the Entry Handling to UniqueEntries.

                If you enable TraceOrders then are you receiving any messages in the output window.


                I look forward to assisting you further.
                JoydeepNinjaTrader Customer Service

                Comment


                  #23
                  Did you receive executions? I dont see why second bars would not work..do you?

                  Entry Handling is set to unique on the strategies tab.

                  Regards.

                  Comment


                    #24
                    Hello Andrew,
                    I have backtested it and its working fine.

                    I will test it on live data once the equity market opens.

                    Thanks for your patience.
                    JoydeepNinjaTrader Customer Service

                    Comment


                      #25
                      Thank you joydeep, please let me know, but if possible let's use second bars as our testing series because I am curious to see if there is any double counting or market data latency impact at all.

                      I am redownloading some corrupted data and trying the backest method myself again.

                      Andrew

                      Comment


                        #26
                        Update:

                        Whether using second or minute and using the date of last friday (11/9/2012)

                        I can not backtest this strategy at all. It moves to an immediately finished state (no processing is done whatsoever) and all results including number of trades are zero.

                        I am completely confused.

                        Comment


                          #27
                          Hello Andrew,
                          If I try backtesting it on seconds charts (from Friday) I am able to get the trades for ORCL and TAP. However most of the trades are trades are for the primary instrument only (I am testing it on APPL).

                          If you download the data for the said instruments using the Historical Data Manager and then try backtesting it then are you able to get it working.
                          JoydeepNinjaTrader Customer Service

                          Comment


                            #28
                            Joydeep:

                            After reloading the corrupted data once more and rebooting, I was able to achieve the desired results with 100% accuracy.

                            Assuming that this fortunate trend continues into the live market, I will consider this matter closed.

                            I have strengthened my knowledge of more intricate coding methods substantially by working with you on this strategy code.

                            I can not thank you enough for helping me put an end this three weeks of coding, which I thought, originally, would take no more than a day.

                            Again, many thanks, I will close this issue formally after watching today's live market.

                            Regards,

                            Andrew

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by bortz, 11-06-2023, 08:04 AM
                            47 responses
                            1,610 views
                            0 likes
                            Last Post aligator  
                            Started by jaybedreamin, Today, 05:56 PM
                            0 responses
                            9 views
                            0 likes
                            Last Post jaybedreamin  
                            Started by DJ888, 04-16-2024, 06:09 PM
                            6 responses
                            19 views
                            0 likes
                            Last Post DJ888
                            by DJ888
                             
                            Started by Jon17, Today, 04:33 PM
                            0 responses
                            6 views
                            0 likes
                            Last Post Jon17
                            by Jon17
                             
                            Started by Javierw.ok, Today, 04:12 PM
                            0 responses
                            16 views
                            0 likes
                            Last Post Javierw.ok  
                            Working...
                            X