diff --git a/CustomMax.mqh b/CustomMax.mqh index ce60189..fb6e8d1 100644 --- a/CustomMax.mqh +++ b/CustomMax.mqh @@ -36,7 +36,7 @@ double CustomMax::calculate_custom_criteria(CUSTOM_MAX_TYPE cm_type){ custom_criteria = win_loss_ratio(); } if(cm_type==CM_WIN_PERCENT){ - custom_criteria = win_percent(); + custom_criteria = win_percent_min_trades(0); } if(cm_type==CM_WIN_PERCENT_200T){ custom_criteria = win_percent_min_trades(200); @@ -73,22 +73,18 @@ double CustomMax::win_loss_ratio(){ double losses = TesterStatistics(STAT_LOSS_TRADES); return wins/losses; } - -double CustomMax::win_percent(){ - double wins = TesterStatistics(STAT_PROFIT_TRADES); - double total_trades = TesterStatistics(STAT_TRADES); - return wins / total_trades * 100; -} double CustomMax::win_percent_min_trades(int min_resuired_trades){ double wins = TesterStatistics(STAT_PROFIT_TRADES); double total_trades = TesterStatistics(STAT_TRADES); + double result = wins / total_trades * 100; - if(total_trades StringToTime(daily_start_time)){ - Print("new bar"); previousTime=bar_open_time; return true; } @@ -116,39 +138,6 @@ bool MyFunctions::in_test_period(MODE_SPLIT_DATA data_split_method){ return false; } - -double MyFunctions::period_high(string symbol, int periods, int shift){ - - double highs[]; - ArraySetAsSeries(highs,true); - CopyHigh(symbol,PERIOD_CURRENT,1,periods+1,highs); - - double high = 0; - high=highs[shift]; - for(int i=shift; ilows[i]){ - low=lows[i]; - } - } - return(low); -} - void MyFunctions::draw_line(double value, string name,color clr){ // EG: // ArrayResize(bar,1000); @@ -180,22 +169,6 @@ void MyFunctions::draw_line(double value, string name,color clr){ ChartRedraw(); } -bool MyFunctions::check_indicator_handles(int &indicator_handles[]){ - // TODO check if working before implementaion: - // e.g. call via: - // int indicator_handles[] = {handle1, handle2, handle..}; - // check_indicator_handles(indicator_handles); - - for(int i =0; i < ArraySize(indicator_handles); i++){ - - if(indicator_handles[i] == INVALID_HANDLE){ - Alert("Failed to create handle"); return false; - }; - } - - return true; -} - double MyFunctions::adjusted_point(string symbol){ int symbol_digits = (int)SymbolInfoInteger(symbol, SYMBOL_DIGITS); @@ -235,19 +208,4 @@ double MyFunctions::get_bid_ask_price(string symbol, int price_side){ return price; -} - - - - - -// // e.g. if(!mf.is_new_daily_bar(symbol, StringToTime("00:06"))){return;} -// bool MyFunctions::is_new_daily_bar(string symbol, datetime start_time){ -// // https://www.youtube.com/watch?v=9BdnTcGrlUM (m-25:00) -// bar_open_time = iTime(symbol,PERIOD_D1,0); -// if(previousTime!=bar_open_time && TimeCurrent() > start_time){ -// previousTime=bar_open_time; -// return true; -// } -// return false; -// } \ No newline at end of file +} \ No newline at end of file diff --git a/NNFX_TestFileHeader.mqh b/NNFX_TestFileHeader.mqh index 38c243b..b630dec 100644 --- a/NNFX_TestFileHeader.mqh +++ b/NNFX_TestFileHeader.mqh @@ -6,12 +6,13 @@ CustomMax cm; MyFunctions mf; OrderManagment om; //--- +string SymbolsArray[]; input LOT_MODE inp_lot_mode = LOT_MODE_PCT_RISK; // Lot Size Mode input double inp_lot_var = 2; // Lot Size Var input SL_MODE inp_sl_mode = SL_ATR_MULTIPLE; // Stop-loss Mode -input double inp_sl_var = 1; // Stop-loss Var +input double inp_sl_var = 1.5; // Stop-loss Var input TP_MODE inp_tp_mode = TP_ATR_MULTIPLE; // Take-profit Mode -input double inp_tp_var = 1.5; // Take-Profit Var +input double inp_tp_var = 1; // Take-Profit Var string lot_mode = EnumToString(inp_lot_mode); string sl_mode = EnumToString(inp_sl_mode); string tp_mode = EnumToString(inp_tp_mode); @@ -20,8 +21,8 @@ input MULTI_SYM_MODE inp_sym_mode = MULTI_SYM_FX_B5; input MODE_SPLIT_DATA inp_data_split_method = NO_SPLIT; input int inp_force_opt = 1; input group "-----------------------------------------" -//---- -string bm5_symbols[] = {"EURUSD", "AUDNZD", "EURGBP", "AUDCAD", "CHFJPY"}; -string fx28_symbols[] = {"EURUSD","AUDNZD","AUDUSD","AUDJPY","EURCHF","EURGBP","EURJPY","GBPCHF","GBPJPY","GBPUSD","NZDUSD","USDCAD","USDCHF","USDJPY","CADJPY","EURAUD","CHFJPY","EURCAD","AUDCAD","AUDCHF","CADCHF","EURNZD","GBPAUD","GBPCAD","GBPNZD","NZDCAD","NZDCHF","NZDJPY",}; + + +