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

strategy analyzer not making entries as expected

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

    strategy analyzer not making entries as expected

    *************DON'T READ THIS YET, I AM EDITING IT.
    *************ATTACHMENT 2 IS NOT CORRECT!!!
    *************I CAN'T FIX THE PROBLEM BY EDITING SO AM SENDING THE REAL
    *************ATTACHMENT 2 IN A RESPONSE ABOVE
    *************SORRY ABOUT THE CONFUSION

    attachment 1 is a strategy's conditions whereby entry is made only if the preceding daily bar was green. the results [not shown] were as was expected [i.e.] entry occurs only if flat and the previous daily bar was green.

    however when attachment 2 conditions are applied in a mirror image attempt to enter both long or short [rather than just short], entry fails to be a function of the previous day being green or red [see attachment 3]. thus far i fail to see the logic of direction of entry in attachment 3?

    the strategy analyzer chart resulting from attachment 2 conditions is displayed in attachment 3.

    help will be much appreciated.

    Click image for larger version

Name:	Apr26#1.JPG
Views:	2
Size:	60.3 KB
ID:	907515

    Click image for larger version

Name:	Apr26#2.JPG
Views:	2
Size:	60.3 KB
ID:	907516

    Click image for larger version

Name:	Apr26#3.JPG
Views:	1
Size:	764.2 KB
ID:	907517
    Last edited by joemiller; 04-26-2017, 02:45 PM.

    #2
    Hello joemiller, and thank you for your question.

    It will be easier to answer questions about strategies not producing expected results if we could answer as many of the following questions as possible. Could you take a few minutes to review these questions? I am happy to explain further any of the below questions and the rationale behind asking them.


    • Do you see expected results when running the same test environment on the SampleMaCrossOver strategy in NinjaTrader with a 3 and 14 period?
      • By expected results, I mean that the SampleMACrossover places trades whenever a 3 and 14 period SMA cross
    • Who are you connected to? This is displayed in green on lower left corner of the Control Center window.
    • Are you connected to your data feed provider when running this test?
    • What instrument(s) (and expiry if applicable) have you selected?
    • What Data Series Type have you selected? Example: Tick, Minute, Day
    • What From and To date is selected?
    • Is your strategy a multi instrument or multi time frame strategy?
    • Do you receive an error on screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by joemiller View Post
      *************don't read this yet, i am editing it.
      *************attachment 2 is not correct!!!
      *************i can't fix the problem by editing so am sending the real
      *************attachment 2 in a response above
      *************sorry about the confusion

      attachment 1 is a strategy's conditions whereby entry is made only if the preceding daily bar was green. The results [not shown] were as was expected [i.e.] entry occurs only if flat and the previous daily bar was green.

      However when attachment 2 conditions are applied in a mirror image attempt to enter both long or short [rather than just short], entry fails to be a function of the previous day being green or red [see attachment 3]. Thus far i fail to see the logic of direction of entry in attachment 3?

      The strategy analyzer chart resulting from attachment 2 conditions is displayed in attachment 3.

      Help will be much appreciated.

      [ATTACH]44322[/ATTACH]

      [ATTACH]44323[/ATTACH]

      [ATTACH]44324[/ATTACH]

      ************the intended real attachment 2 [i hope]
      [ATTACH]44325[/ATTACH]

      Comment


        #4
        Originally posted by NinjaTrader_JessicaP View Post
        Hello joemiller, and thank you for your question.

        It will be easier to answer questions about strategies not producing expected results if we could answer as many of the following questions as possible. Could you take a few minutes to review these questions? I am happy to explain further any of the below questions and the rationale behind asking them.


        • Do you see expected results when running the same test environment on the SampleMaCrossOver strategy in NinjaTrader with a 3 and 14 period?
          • By expected results, I mean that the SampleMACrossover places trades whenever a 3 and 14 period SMA cross
        • Who are you connected to? This is displayed in green on lower left corner of the Control Center window.
        • Are you connected to your data feed provider when running this test?
        • What instrument(s) (and expiry if applicable) have you selected?
        • What Data Series Type have you selected? Example: Tick, Minute, Day
        • What From and To date is selected?
        • Is your strategy a multi instrument or multi time frame strategy?
        • Do you receive an error on screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?
        Do you see expected results when running the same test environment on the SampleMaCrossOver strategy in NinjaTrader with a 3 and 14 period?
        By expected results, I mean that the SampleMACrossover places trades whenever a 3 and 14 period SMA cross
        YES

        Who are you connected to? This is displayed in green on lower left corner of the Control Center window.
        CONTINUUM JOINT ACCOUNT & FXCM FOREX

        Are you connected to your data feed provider when running this test?
        YES

        What instrument(s) (and expiry if applicable) have you selected?
        ES 06-17

        What Data Series Type have you selected? Example: Tick, Minute, Day
        DAY

        What From and To date is selected?
        01/01/2017 TO 04/25/17

        Is your strategy a multi instrument or multi time frame strategy?
        NO

        Do you receive an error on screen?
        NO

        Are there errors on the Log tab of the Control Center? If so, what do these errors report?
        NO

        Comment


          #5
          Thank you for this information Joe. After seeing both of your attachments, it looks like we can do a better job explaining how managed order entry methods are designed to work.

          If you are already in a long position, and ...

          • You call EnterLong again, if your entries per direction is ...
            • 1, you will not enter another trade
            • More than 1, you will enter trades again and again until your entries per direction is met

          • You call Enter Short, your position will reverse. All your long contracts will close out, and you will enter the specified number of short contracts

          Since it seems you would like to only enter trades if you are flat the code for this is


          Code:
          [FONT=Courier New]if (CurrentBars[0] < 1)
          return;
          
          
          if (Close[0] > Open[1][B] && Position.MarketPosition == MarketPosition.Flat[/B])
          {
              EnterLong(Convert.ToInt32(DefaultQuantity), "");
          
          }
          
          
          
          if (Close[0] < Open[1][B] && Position.MarketPosition == MarketPosition.Flat[/B])
          {
              EnterShort(Convert.ToInt32(DefaultQuantity), "");
          }[/FONT]
          Please let us know if there are any other ways we can help.
          Jessica P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by rtwave, 04-12-2024, 09:30 AM
          4 responses
          29 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Started by yertle, Yesterday, 08:38 AM
          7 responses
          28 views
          0 likes
          Last Post yertle
          by yertle
           
          Started by bmartz, 03-12-2024, 06:12 AM
          2 responses
          21 views
          0 likes
          Last Post bmartz
          by bmartz
           
          Started by funk10101, Today, 12:02 AM
          0 responses
          6 views
          0 likes
          Last Post funk10101  
          Started by gravdigaz6, Yesterday, 11:40 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X