Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems joining 2 or more strategies in one.

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

    Problems joining 2 or more strategies in one.

    Hi all:
    I'm trying to join 2 or more strategy's algorithms in only one, having a bool flag to activate an deactivate each individual algorithm. Each algorithm runs on its own timeframe bars, and execute EnterLong/Short with uniquely named signals (different from other algorithms). The global strategy gives correct executions/tradings when only one of the algorithms is activated, i.e. the results are the same of the independent strategy being added to the global one. But when two or more algorithms are activated, the trades executions are very strange, accumulating too much executions on consecutive bars from time to time, and giving a result of executions that are very different from the sum of each independent algorithm.
    I have tried adjusting the Order Handling parameters to Entries per direction=1 and Entry handling=UniqueEntries, but results makes non sense.
    Thank you very much for your help and suggestions in advance.

    Follow an example of executions and the parameters for the backtest(for the last run with the 2 true flags activated):

    algorithm 1 activated:
    Executions:

    Instrument Action Qty Price Time ID E/X Position Order ID Name Commission Rate Account Connection
    FDAX 03-09 Buy 1 5022 06/01/2009 8:05 NT-00000 Entry 1L NT-00000 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4967,5 07/01/2009 14:45 NT-00001 Exit - NT-00001 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4967,5 07/01/2009 14:45 NT-00002 Entry 1S NT-00002 VMA1 0 1 Back101
    FDAX 03-09 Buy 1 4506 28/01/2009 14:40 NT-00003 Exit - NT-00003 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4506 28/01/2009 14:40 NT-00004 Entry 1L NT-00004 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4462,5 29/01/2009 10:30 NT-00005 Exit - NT-00005 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4462,5 29/01/2009 10:30 NT-00006 Entry 1S NT-00006 VMA1 0 1 Back101
    FDAX 03-09 Buy 1 4466 04/02/2009 15:50 NT-00007 Exit - NT-00007 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4466 04/02/2009 15:50 NT-00008 Entry 1L NT-00008 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4420 05/02/2009 8:55 NT-00009 Exit - NT-00009 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4420 05/02/2009 8:55 NT-00010 Entry 1S NT-00010 VMA1 0 1 Back101
    FDAX 03-09 Buy 1 4459,5 05/02/2009 11:00 NT-00011 Exit - NT-00011 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4459,5 05/02/2009 11:00 NT-00012 Entry 1L NT-00012 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4408 05/02/2009 16:15 NT-00013 Exit - NT-00013 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4408 05/02/2009 16:15 NT-00014 Entry 1S NT-00014 VMA1 0 1 Back101
    FDAX 03-09 Buy 1 4483,5 05/02/2009 17:00 NT-00015 Exit - NT-00015 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4483,5 05/02/2009 17:00 NT-00016 Entry 1L NT-00016 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4474,5 10/02/2009 20:20 NT-00017 Exit - NT-00017 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4474,5 10/02/2009 20:20 NT-00018 Entry 1S NT-00018 VMA1 0 1 Back101
    FDAX 03-09 Buy 1 4519,5 11/02/2009 9:50 NT-00019 Exit - NT-00019 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4519,5 11/02/2009 9:50 NT-00020 Entry 1L NT-00020 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4462 12/02/2009 9:35 NT-00021 Exit - NT-00021 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4462 12/02/2009 9:35 NT-00022 Entry 1S NT-00022 VMA1 0 1 Back101
    FDAX 03-09 Buy 1 3649 09/03/2009 21:25 NT-00023 Exit - NT-00023 Exit on close 0 1 Back101


    algorithm 2 activated:
    Executions:

    Instrument Action Qty Price Time ID E/X Position Order ID Name Commission Rate Account Connection
    FDAX 03-09 Buy 1 5011,5 06/01/2009 8:45 NT-00000 Entry 1L NT-00000 EMA1 0 1 Back101
    FDAX 03-09 Sell 1 4984,5 06/01/2009 9:30 NT-00001 Exit - NT-00001 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4984,5 06/01/2009 9:30 NT-00002 Entry 1S NT-00002 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 5017,5 06/01/2009 10:10 NT-00003 Exit - NT-00003 Close position 0 1 Back101
    FDAX 03-09 Buy 1 5017,5 06/01/2009 10:10 NT-00004 Entry 1L NT-00004 EMA1 0 1 Back101
    FDAX 03-09 Sell 1 4988 07/01/2009 9:45 NT-00005 Exit - NT-00005 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4988 07/01/2009 9:45 NT-00006 Entry 1S NT-00006 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4483,5 04/02/2009 16:00 NT-00007 Exit - NT-00007 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4483,5 04/02/2009 16:00 NT-00008 Entry 1L NT-00008 EMA1 0 1 Back101
    FDAX 03-09 Sell 1 4448,5 04/02/2009 19:55 NT-00009 Exit - NT-00009 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4448,5 04/02/2009 19:55 NT-00010 Entry 1S NT-00010 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4472 05/02/2009 11:35 NT-00011 Exit - NT-00011 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4472 05/02/2009 11:35 NT-00012 Entry 1L NT-00012 EMA1 0 1 Back101
    FDAX 03-09 Sell 1 4434,5 05/02/2009 14:40 NT-00013 Exit - NT-00013 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4434,5 05/02/2009 14:40 NT-00014 Entry 1S NT-00014 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4483,5 05/02/2009 17:00 NT-00015 Exit - NT-00015 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4483,5 05/02/2009 17:00 NT-00016 Entry 1L NT-00016 EMA1 0 1 Back101
    FDAX 03-09 Sell 1 4392,5 12/02/2009 16:05 NT-00017 Exit - NT-00017 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4392,5 12/02/2009 16:05 NT-00018 Entry 1S NT-00018 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 3649 09/03/2009 21:25 NT-00019 Exit - NT-00019 Exit on close 0 1 Back101

    #2
    Listing Continuation.

    algorithm 1 AND 2 activated:
    Executions:
    Instrument Action Qty Price Time ID E/X Position Order ID Name Commission Rate Account Connection
    FDAX 03-09 Buy 1 5022 06/01/2009 8:05 NT-00000 Entry 1L NT-00000 VMA1 0 1 Back101
    FDAX 03-09 Buy 1 5011,5 06/01/2009 8:45 NT-00001 Entry 2L NT-00001 EMA1 0 1 Back101
    FDAX 03-09 Sell 2 4984,5 06/01/2009 9:30 NT-00002 Exit - NT-00002 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4984,5 06/01/2009 9:30 NT-00003 Entry 1S NT-00003 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4982 06/01/2009 9:35 NT-00004 Exit - NT-00004 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4982 06/01/2009 9:35 NT-00005 Entry 1L NT-00005 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4982 06/01/2009 9:35 NT-00006 Exit - NT-00006 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4982 06/01/2009 9:35 NT-00007 Entry 1S NT-00007 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4987 06/01/2009 9:40 NT-00008 Exit - NT-00008 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4987 06/01/2009 9:40 NT-00009 Entry 1L NT-00009 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4987 06/01/2009 9:40 NT-00010 Exit - NT-00010 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4987 06/01/2009 9:40 NT-00011 Entry 1S NT-00011 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4986 06/01/2009 9:45 NT-00012 Exit - NT-00012 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4986 06/01/2009 9:45 NT-00013 Entry 1L NT-00013 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4986 06/01/2009 9:45 NT-00014 Exit - NT-00014 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4986 06/01/2009 9:45 NT-00015 Entry 1S NT-00015 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4991 06/01/2009 9:50 NT-00016 Exit - NT-00016 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4991 06/01/2009 9:50 NT-00017 Entry 1L NT-00017 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4986 06/01/2009 9:55 NT-00018 Exit - NT-00018 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4986 06/01/2009 9:55 NT-00019 Entry 1S NT-00019 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 5000,5 06/01/2009 10:00 NT-00020 Exit - NT-00020 Close position 0 1 Back101
    FDAX 03-09 Buy 1 5000,5 06/01/2009 10:00 NT-00021 Entry 1L NT-00021 VMA1 0 1 Back101
    FDAX 03-09 Buy 1 5017,5 06/01/2009 10:10 NT-00022 Entry 2L NT-00022 EMA1 0 1 Back101
    FDAX 03-09 Sell 2 4988 07/01/2009 9:45 NT-00023 Exit - NT-00023 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4988 07/01/2009 9:45 NT-00024 Entry 1S NT-00024 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4987 07/01/2009 9:50 NT-00025 Exit - NT-00025 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4987 07/01/2009 9:50 NT-00026 Entry 1L NT-00026 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4987 07/01/2009 9:50 NT-00027 Exit - NT-00027 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4987 07/01/2009 9:50 NT-00028 Entry 1S NT-00028 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4988 07/01/2009 9:55 NT-00029 Exit - NT-00029 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4988 07/01/2009 9:55 NT-00030 Entry 1L NT-00030 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4988 07/01/2009 9:55 NT-00031 Exit - NT-00031 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4988 07/01/2009 9:55 NT-00032 Entry 1S NT-00032 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4990 07/01/2009 10:00 NT-00033 Exit - NT-00033 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4990 07/01/2009 10:00 NT-00034 Entry 1L NT-00034 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4990 07/01/2009 10:00 NT-00035 Exit - NT-00035 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4990 07/01/2009 10:00 NT-00036 Entry 1S NT-00036 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4994 07/01/2009 10:05 NT-00037 Exit - NT-00037 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4994 07/01/2009 10:05 NT-00038 Entry 1L NT-00038 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4994 07/01/2009 10:05 NT-00039 Exit - NT-00039 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4994 07/01/2009 10:05 NT-00040 Entry 1S NT-00040 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4996,5 07/01/2009 10:10 NT-00041 Exit - NT-00041 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4996,5 07/01/2009 10:10 NT-00042 Entry 1L NT-00042 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4985,5 07/01/2009 10:15 NT-00043 Exit - NT-00043 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4985,5 07/01/2009 10:15 NT-00044 Entry 1S NT-00044 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4987,5 07/01/2009 10:20 NT-00045 Exit - NT-00045 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4987,5 07/01/2009 10:20 NT-00046 Entry 1L NT-00046 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4987,5 07/01/2009 10:20 NT-00047 Exit - NT-00047 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4987,5 07/01/2009 10:20 NT-00048 Entry 1S NT-00048 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4992 07/01/2009 10:25 NT-00049 Exit - NT-00049 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4992 07/01/2009 10:25 NT-00050 Entry 1L NT-00050 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4992 07/01/2009 10:25 NT-00051 Exit - NT-00051 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4992 07/01/2009 10:25 NT-00052 Entry 1S NT-00052 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4979,5 07/01/2009 10:30 NT-00053 Exit - NT-00053 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4979,5 07/01/2009 10:30 NT-00054 Entry 1L NT-00054 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4979,5 07/01/2009 10:30 NT-00055 Exit - NT-00055 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4979,5 07/01/2009 10:30 NT-00056 Entry 1S NT-00056 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4994,5 07/01/2009 10:35 NT-00057 Exit - NT-00057 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4994,5 07/01/2009 10:35 NT-00058 Entry 1L NT-00058 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4994,5 07/01/2009 10:35 NT-00059 Exit - NT-00059 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4994,5 07/01/2009 10:35 NT-00060 Entry 1S NT-00060 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4995,5 07/01/2009 10:40 NT-00061 Exit - NT-00061 Close position 0 1 Back101
    FDAX 03-09 Buy 1 4995,5 07/01/2009 10:40 NT-00062 Entry 1L NT-00062 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4995,5 07/01/2009 10:40 NT-00063 Exit - NT-00063 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4995,5 07/01/2009 10:40 NT-00064 Entry 1S NT-00064 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 5006 07/01/2009 10:45 NT-00065 Exit - NT-00065 Close position 0 1 Back101
    FDAX 03-09 Buy 1 5006 07/01/2009 10:45 NT-00066 Entry 1L NT-00066 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4993 07/01/2009 11:15 NT-00067 Exit - NT-00067 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4993 07/01/2009 11:15 NT-00068 Entry 1S NT-00068 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 5002 07/01/2009 11:20 NT-00069 Exit - NT-00069 Close position 0 1 Back101
    FDAX 03-09 Buy 1 5002 07/01/2009 11:20 NT-00070 Entry 1L NT-00070 VMA1 0 1 Back101
    FDAX 03-09 Sell 1 4987 07/01/2009 14:25 NT-00071 Exit - NT-00071 Close position 0 1 Back101
    FDAX 03-09 Sell 1 4987 07/01/2009 14:25 NT-00072 Entry 1S NT-00072 EMA1 0 1 Back101
    FDAX 03-09 Buy 1 4992,5 07/01/2009 14:30 NT-00073 Exit - NT-00073 Close position 0 1 Back101

    Comment


      #3
      End Listing.

      .....AND SO ON....


      PARAMETERS SETTINGS:

      Item Value





      Parameters




      Parameters
      AOOOEXPYSIM1 3400
      AOOOEXPYSIM2 2400
      Coefecciic1 3
      Coefecciic2 2
      MCORTA1 10
      MCORTA2 10
      Mediaaberr1 60
      Mediaaberr2 25
      MLARGA1 200
      MLARGA2 200
      ON_Bollinger1 False
      ON_Bollinger2 False
      ON_CruceVMA1 True
      ON_CruceVMA2 False
      ON_SupEMASMA1 True
      ON_SupEMASMA2 False
      TbarraInterna1 5
      TbarraInterna2 5
      TbarraInterna3 15




      Data series



      Data series
      Type Minute
      Value 5



      Time frame


      Time frame


      From 01/01/2009


      To 19/04/2009
      Exclude weekend False
      Session begins (local time) 0:00
      Session ends (local time) 0:00
      General General
      Include commission False
      Label FusionSistemas_v1p2
      Min. bars required 20
      Historical Fill Processing Historical Fill Processing
      Fill type Default
      Slippage 0
      Order Handling Order Handling
      Entries per direction 1
      Entry handling UniqueEntries
      Exit on close False
      Order Properties Order Properties
      Set order quantity by strategy
      Time in force Gtc

      Comment


        #4
        jsatips,

        You will have to debug your strategy to see exactly where the difference is. Please use TraceOrders = true to figure out what your trades are doing and if they are being ignored for any reason.

        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        332 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X