List of changes - This is an overview and summary of the reasoning. I will put the code in a separate email, like this one. Paste it into the MetaEditor and compile it. It should compile. I don't see how to make an attachment. I took the most important last step - compiled and ran a test to make sure you still have the same results. changed TakeProfit Mode12_TakeProfit StopLoss Mode12_StopLoss TrailingStop Mode12_TrailingStop MM MoneyManagement added a few commments extern bool MoneyManagement = true; // auto decrease lotsize if > 1 losses in a row. One of the confusing things is Mode2_CloseFirstTrade Mode2_CloseFirstTrade becomes Mode2_CloseTrade_1 The order of the fields are changed to make the common settings appear first. The same change in ordering is applied in the init paragragh. All Extern variable get a prefix to help people easily know if they need to enter a value themselves. All external variables are either User settings - Prefered Settings - or Comments - Added some comments within external variables, matching your style. //+--------------------------------------------------------------------------------------------------+ //| Fields the start with U - are USER fields - that the user always chooses. //| - contain defaults that are the same for all currencies. //| - You can set these as you choose, even if you choose to use //| the preferred settings. //| //| P - If you set PrefSettings to False then you need to set all the //| external fields starting with P_ to your own settings. //| //| C - These are comments //+--------------------------------------------------------------------------------------------------+ extern string C_INIT = "=== Use INIT section - ignore all P_ settings ====="; extern bool U_PrefSettings = true; extern string C_PhoenixSettings = "===== Phoenix Mode Selected =============================="; extern int U_PhoenixModeSelected = 3; extern string C_FYI = "Set Mode Settings for the mode selected above."; extern string C_Mode1 = "==== Phoenix Mode 1 (Classic - One Trade) ================"; extern int U_Mode1_BreakEvenAfterPips = 0; extern string C_Mode12_Settings = "==== Phoenix Mode 1 & 2 - shared fields =================="; extern int P_Mode12_TakeProfit = 0; extern int P_Mode12_StopLoss = 0; extern int P_Mode12_TrailingStop = 0; extern string C_Mode2 = "==== Phoenix Mode 2 (Classic-Plus second trade later) ===="; extern int P_Mode2_TakeProfit_T2 = 0; extern int P_Mode2_StopLoss_T2 = 0; extern int P_Mode2_OpenTrade_2 = 0; // Open Trade 2 after a protfit of this many pips extern bool U_Mode2_CloseTrade_1 = false; // If True the first trade closes when the second opens extern string C_Mode3 = "==== Phoenix Mode 3 (Three trades at once) ==============="; extern int P_Mode3_TakeProfit = 0; extern int P_Mode3_StopLoss = 0; extern int P_Mode3_CloseTrade2_3 = 0; AccountMicro changed to AccountIsMicro because if(AccountIsMicro==true) decimalPlaces=2; is a little more clear to the reader. All the fields which have a Red L under the live section now start with R_ for Required. It means people do not have to look at the documentation for that information. _________________________________________________ Function names where changed so that if it is mode 1 only - it starts with M1_ mode 2 only - it starts with M2_ mode 3 only - it starts with M3_ a shared function - it starts with S#_ Money Management - starts with Y_MM Setting the signals - starts with Z_ All program functions are preceded by a prefix to make them easily distinguishable from the built in functions of the product. All the functions are sorted alphabetically by the new paragragh prefixes, to make them easier to find. The M# and S# functions are all very phoenix, The x the Y and Z functions could be part of any expert advizer. _________________________________________________ Any reference to 123 becomes Mode3 or M3, so that there is no confusion. - I know you like that name Phoenix 123 but I was confused initially in the difference between the 3 modes - I noticed you get a lot of questions about the 3 modes. So changing a couple of comments could reduce the questions, particularily because people won't read your documentation. Human nature for some. ---- Begin ----------- Is this a bug that doesn't actually cause a problem --------------------- ---------------------- see where I wrote "<------------- should it be continue" --------------- void Mode3_MoveSL_Trade_3() { double NewSLTrade3B,NewSLTrade3S; int err = 0, total = OrdersTotal(), history = HistoryTotal(); bool ChangeStopLoss = false; for(int z = history - 1; z >= 0; z --) { if(!OrderSelect( z,SELECT_BY_POS,MODE_HISTORY)) { err = GetLastError(); Print("OrderSelect( ", z, ", SELECT_BY_POS ) - Error #",err ); continue; } if(OrderSymbol() != Symbol()) continue; if(OrderMagicNumber() == MAGICMA03) break; if(OrderMagicNumber() == MAGICMA01) break; <------------- should it be continue if(OrderMagicNumber() != MAGICMA02) continue; ---- end ----------- Is this a bug that doesn't matter --------------------- Mode3_MoveSL_Trade_3 becomes M3_C_MoveSL_Trade_3_to_CalcPrice renamed External variables - Added some comments that within external variables, matching your style. Regrouped and reorder the most External Variables to make them - more intuitive to understand - to put them in the order that they are used in the paragraghs Regrouped the PrefSettings so they matched the order that they appear in the External Variables section. - makes it easier to match the code to the external variables. - you may have done this before, but after I reordered the External variables I ensured consistency. I violated the rules of paragragh capitalization or format when following them made the names hard to decifer. example M1_B_UpdateTrailingStop_if_BreakEven instead of M1BUpdateTrailingStopIfBreakEven. My goal is to make it easier to understand for knowledgeable programmers and the average Joe. One suggested change left for you to do. //+------------------------------------------------------------------+ //| START Function Z Check Signals | //+------------------------------------------------------------------+ //=====================SIGNAL1======================== int Z_CheckSignals(int Signal) Change Z_CheckSignals to return a string that says Buy or Sell. The following function would be easy to understand int S1_Mode_1_2_OpenTrade_If_Signal() { int Signal=0, err = 0, total = OrdersTotal(); if(S1_1_NumberOfOpenOrders(Symbol()) < 1) { if(Z_CheckSignals(Signal)==1) // If Sell Signal // The above line would read if("Z_CheckSignals(Signal)"=="Sell") There may be a couple of misconceptions on my part which resulted in my misnaming the function of a paragragh, so you might have some changes to make to what I've done.