10036 invalid return code of the trade server - Seite 2

 
Christian Linden #:

Das heißt, meinem Verständnis nach, dass ich bei einem FreezeLevel von 0 immer was verändern kann, dass der Fehler also hier nicht liegt.
Aber nach Carl ist das wohl falsch, ich weiß es nicht.
Ich weiß nur, dass der TrailingStop-EA auf das NettingKonto des gleichen Brokers funktioniert, auf dessen HedgingKonto es nicht geht; ich habe es umstellen lassen, weil ich gesehen habe,
dass das von ActivTrades ein Netting ist, wo es funktionierte.

Das liegt an der programmierung, was für hedging geht geht auch für netting aber nicht umgekehrt.

der freezlevel liegt woanders, der hat damit nix zu tun.

such dir was mit einer ordentlichen programmierung

 

Mann sollte nicht denken, was etwas bedeuten soll nach eigenem Verständnis!

Man sollte nachlesen, was es faktisch bedeutet und wie es das Handeln - in unserem Fall - bedeutet.

Die Suche nach SYMBOL_TRADE_FREEZE_LEVEL  ergab zB. dies:

https://www.mql5.com/de/articles/2555#modify_in_freeze_level_prohibited:

Der Typ  der Order/Position
Aktivierung nach dem Preis
Überprüfung
Buy Limit Order
 Ask
Ask-OpenPrice >= SYMBOL_TRADE_FREEZE_LEVEL
Buy Stop Order  Ask OpenPrice-Ask >= SYMBOL_TRADE_FREEZE_LEVEL
Sell Limit ордер  Bid OpenPrice-Bid >= SYMBOL_TRADE_FREEZE_LEVEL
Sell Stop Order  Bid Bid-OpenPrice >= SYMBOL_TRADE_FREEZE_LEVEL
Buy Position
 Bid TakeProfit-Bid >= SYMBOL_TRADE_FREEZE_LEVEL
Bid-StopLoss >= SYMBOL_TRADE_FREEZE_LEVEL
Sell Position
 Ask Ask-TakeProfit >= SYMBOL_TRADE_FREEZE_LEVEL
StopLoss-Ask >= SYMBOL_TRADE_FREEZE_LEVEL

oder dies: https://www.mql5.com/de/forum/409880/page922#comment_36375343

Nein, nicht verwirrt. SYMBOL_TRADE_STOPS_LEVEL ist der Mindestabstand von SL oder TP vom Marktpreis zum Zeitpunkt der Festlegung oder Änderung
Und SYMBOL_TRADE_FREEZE_LEVEL verbietet die Änderung von SL- oder TP-Levels, wenn der Marktpreis zu diesem Zeitpunkt näher an ihnen liegt als SYMBOL_TRADE_FREEZE_LEVEL
Es ist nur so, dass ich einen EA schreibe, dessen Strategie ursprünglich auf M1 empfohlen wurde und SYMBOL_TRADE_FREEZE_LEVEL kann verbieten, einen Teil einer Bestellung zu schließen

Noch Fragen?

Welche Überprüfungen der Handelsroboter vor der Veröffentlichung in Market bestehen soll
Welche Überprüfungen der Handelsroboter vor der Veröffentlichung in Market bestehen soll
  • www.mql5.com
Alle Markets Produkte vor der Veröffentlichung bestehen eine obligatorische vorläufige Überprüfung, um eine Standarte Qualität zu haben. In diesem Artikel werden wir von den häufigsten Fehlern erzählen, die die Hersteller in den Handelsrobotern und den technischen Indikatoren machen. Auch werden wir zeigen, wie man sein Produkt vor der Sendung in Market selbständig überprüfen soll.
 
Carl Schreiber #:

Mann sollte nicht denken, was etwas bedeuten soll nach eigenem Verständnis!

Man sollte nachlesen, was es faktisch bedeutet und wie es das Handeln - in unserem Fall - bedeutet.

Die Suche nach SYMBOL_TRADE_FREEZE_LEVEL  ergab zB. dies:

https://www.mql5.com/de/articles/2555#modify_in_freeze_level_prohibited:

Der Typ  der Order/Position
Aktivierung nach dem Preis
Überprüfung
Buy Limit Order
 Ask
Ask-OpenPrice >= SYMBOL_TRADE_FREEZE_LEVEL
Buy Stop Order  Ask OpenPrice-Ask >= SYMBOL_TRADE_FREEZE_LEVEL
Sell Limit ордер  Bid OpenPrice-Bid >= SYMBOL_TRADE_FREEZE_LEVEL
Sell Stop Order  Bid Bid-OpenPrice >= SYMBOL_TRADE_FREEZE_LEVEL
Buy Position
 Bid TakeProfit-Bid >= SYMBOL_TRADE_FREEZE_LEVEL
Bid-StopLoss >= SYMBOL_TRADE_FREEZE_LEVEL
Sell Position
 Ask Ask-TakeProfit >= SYMBOL_TRADE_FREEZE_LEVEL
StopLoss-Ask >= SYMBOL_TRADE_FREEZE_LEVEL

oder dies: https://www.mql5.com/de/forum/409880/page922#comment_36375343

Noch Fragen?

ist ja genau was ich geschrieben habe, nachdem er von trailing stop redet kann es sich ja nur um Positions handeln.

und beim 22ten problem finden wir hier was es braucht für hedge bzw netting

https://www.mql5.com/de/articles/2299



oder hier


https://www.mql5.com/en/docs/trading/positionselect

Hedging-System zur Verrechnung von Positionen in MetaTrader 5 verfügbar
Hedging-System zur Verrechnung von Positionen in MetaTrader 5 verfügbar
  • www.mql5.com
Um Möglichkeiten von Retail-Tradern zu erweitern, wurde das zweite System der Aufrechnung von Positionen — Hedging — auf der Plattform hinzugefügt. Nun kann man eine Vielzahl von Positionen pro Symbol haben, darunter auch gegenläufige. Dank Hedging kann man Handelstrategien mit dem sogenannten "Locking" umsetzen: wenn sich der Preis gegen den Trader entwickelt, kann der Trader eine Position in einer entgegengesetzten Richtung eröffnen.
 
amando #:

Das liegt an der programmierung, was für hedging geht geht auch für netting aber nicht umgekehrt.

der freezlevel liegt woanders, der hat damit nix zu tun.

such dir was mit einer ordentlichen programmierung

Ich wage mich tatsächlich selbst an die Programmierung bzw. übernehme nur Code, den ich verstehe.
Den Code für den TrailingStop fürs Hedging muss ich mich noch ansehen, ich werde leider nicht dafür bezahlt und geh' gerade in anderem Kram unter.

Ich bin mir sicher, dass man profitabel traden kann ohne perfekt im Coden zu sein bzw. ohne den perfekten Code, der macht es nicht aus.

Aber danke Euch, wie immer.

 
Christian Linden #:

Ich wage mich tatsächlich selbst an die Programmierung bzw. übernehme nur Code, den ich verstehe.
Den Code für den TrailingStop fürs Hedging muss ich mich noch ansehen, ich werde leider nicht dafür bezahlt und geh' gerade in anderem Kram unter.

Ich bin mir sicher, dass man profitabel traden kann ohne perfekt im Coden zu sein bzw. ohne den perfekten Code, der macht es nicht aus.

Aber danke Euch, wie immer.

Kann es sein, das:


#include <errordescription.mqh>

einfach den returncode nicht kennt? 

 
Christian #:

Kann es sein, das:


einfach den returncode nicht kennt? 

Das macht Sinn:

//+------------------------------------------------------------------+
//|                                             ErrorDescription.mqh |
//|                        Copyright 2010, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "2010, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| returns trade server return code description                     |
//+------------------------------------------------------------------+
string TradeServerReturnCodeDescription(int return_code)
  {
//---
   switch(return_code)
     {
      case TRADE_RETCODE_REQUOTE:            return("Requote");
      case TRADE_RETCODE_REJECT:             return("Request rejected");
      case TRADE_RETCODE_CANCEL:             return("Request canceled by trader");
      case TRADE_RETCODE_PLACED:             return("Order placed");
      case TRADE_RETCODE_DONE:               return("Request is completed");
      case TRADE_RETCODE_DONE_PARTIAL:       return("Request is partially completed");
      case TRADE_RETCODE_ERROR:              return("Request processing error");
      case TRADE_RETCODE_TIMEOUT:            return("Request canceled by timeout");
      case TRADE_RETCODE_INVALID:            return("Invalid request");
      case TRADE_RETCODE_INVALID_VOLUME:     return("Invalid volume in the request");
      case TRADE_RETCODE_INVALID_PRICE:      return("Invalid price in the request");
      case TRADE_RETCODE_INVALID_STOPS:      return("Invalid stops in the request");
      case TRADE_RETCODE_TRADE_DISABLED:     return("Trade is disabled");
      case TRADE_RETCODE_MARKET_CLOSED:      return("Market is closed");
      case TRADE_RETCODE_NO_MONEY:           return("There is not enough money to fulfill the request");
      case TRADE_RETCODE_PRICE_CHANGED:      return("Prices changed");
      case TRADE_RETCODE_PRICE_OFF:          return("There are no quotes to process the request");
      case TRADE_RETCODE_INVALID_EXPIRATION: return("Invalid order expiration date of in the request");
      case TRADE_RETCODE_ORDER_CHANGED:      return("Order state changed");
      case TRADE_RETCODE_TOO_MANY_REQUESTS:  return("Too frequent requests");
      case TRADE_RETCODE_NO_CHANGES:         return("No changes in request");
      case TRADE_RETCODE_SERVER_DISABLES_AT: return("Autotrading disabled by server");
      case TRADE_RETCODE_CLIENT_DISABLES_AT: return("Autotrading disabled by client terminal");
      case TRADE_RETCODE_LOCKED:             return("Request locked for processing");
      case TRADE_RETCODE_FROZEN:             return("Order or position frozen");
      case TRADE_RETCODE_INVALID_FILL:       return("Invalid order filling type"); 
      case TRADE_RETCODE_CONNECTION:         return("No connection with the trade server"); 
      case TRADE_RETCODE_ONLY_REAL:          return("Operation is allowed only for live accounts");     
      case TRADE_RETCODE_LIMIT_ORDERS:       return("The number of pending orders has reached the limit"); 
      case TRADE_RETCODE_LIMIT_VOLUME:       return("The volume of orders and positions for the symbol has reached the limit"); 
     }
//---
   return("Invalid return code of the trade server");
  }
//+------------------------------------------------------------------+
//| returns runtime error code description                           |
//+------------------------------------------------------------------+
string ErrorDescription(int err_code)
  {
//---
   switch(err_code)
     {
      case ERR_INTERNAL_ERROR:               return("Unexpected internal error");
      case ERR_WRONG_INTERNAL_PARAMETER:     return("Wrong parameter in the inner call of the client terminal function");
      case ERR_INVALID_PARAMETER:            return("Wrong parameter when calling the system function");
      case ERR_NOT_ENOUGH_MEMORY:            return("Not enough memory to perform the system function");
      case ERR_STRUCT_WITHOBJECTS_ORCLASS:   return("The structure contains objects of strings and/or dynamic arrays and/or structure of such objects and/or classes");
      case ERR_INVALID_ARRAY:                return("Array of a wrong type, wrong size, or a damaged object of a dynamic array");
      case ERR_ARRAY_RESIZE_ERROR:           return("Not enough memory for the relocation of an array, or an attempt to change the size of a static array");
      case ERR_STRING_RESIZE_ERROR:          return("Not enough memory for the relocation of string");
      case ERR_NOTINITIALIZED_STRING:        return("Not initialized string");
      case ERR_INVALID_DATETIME:             return("Invalid date and/or time");
      case ERR_ARRAY_BAD_SIZE:               return("Requested array size exceeds 2 GB");
      case ERR_INVALID_POINTER:              return("Wrong pointer");
      case ERR_INVALID_POINTER_TYPE:         return("Wrong type of pointer");
      case ERR_FUNCTION_NOT_ALLOWED:         return("System function is not allowed to call");
      case ERR_CHART_WRONG_ID:               return("Wrong chart ID");
      case ERR_CHART_NO_REPLY:               return("Chart does not respond");
      case ERR_CHART_NOT_FOUND:              return("Chart not found");
      case ERR_CHART_NO_EXPERT:              return("No Expert Advisor in the chart that could handle the event");
      case ERR_CHART_CANNOT_OPEN:            return("Chart opening error");
      case ERR_CHART_CANNOT_CHANGE:          return("Failed to change chart symbol and period");
      //case ERR_CHART_WRONG_TIMER_PARAMETER:  return("Wrong parameter for timer");
      case ERR_CHART_CANNOT_CREATE_TIMER:    return("Failed to create timer");
      case ERR_CHART_WRONG_PROPERTY:         return("Wrong chart property ID");
      case ERR_CHART_SCREENSHOT_FAILED:      return("Error creating screenshots");
      case ERR_CHART_NAVIGATE_FAILED:        return("Error navigating through chart");
      case ERR_CHART_TEMPLATE_FAILED:        return("Error applying template");
      case ERR_CHART_WINDOW_NOT_FOUND:       return("Subwindow containing the indicator was not found");
      case ERR_OBJECT_ERROR:                 return("Error working with a graphical object");
      case ERR_OBJECT_NOT_FOUND:             return("Graphical object was not found");
      case ERR_OBJECT_WRONG_PROPERTY:        return("Wrong ID of a graphical object property");
      case ERR_OBJECT_GETDATE_FAILED:        return("Unable to get date corresponding to the value");
      case ERR_OBJECT_GETVALUE_FAILED:       return("Unable to get value corresponding to the date");
      case ERR_MARKET_UNKNOWN_SYMBOL:        return("Unknown symbol");
      case ERR_MARKET_SELECT_ERROR:          return("Symbol is not selected in MarketWatch");
      case ERR_MARKET_WRONG_PROPERTY:        return("Wrong identifier of a symbol property");
      case ERR_MARKET_LASTTIME_UNKNOWN:      return("Time of the last tick is not known (no ticks)");
      case ERR_HISTORY_NOT_FOUND:            return("Requested history not found");
      case ERR_HISTORY_WRONG_PROPERTY:       return("Wrong ID of the history property");
      case ERR_GLOBALVARIABLE_NOT_FOUND:     return("Global variable of the client terminal is not found");
      case ERR_GLOBALVARIABLE_EXISTS:        return("Global variable of the client terminal with the same name already exists");
      case ERR_MAIL_SEND_FAILED:             return("Email sending failed");
      case ERR_PLAY_SOUND_FAILED:            return("Sound playing failed");
      case ERR_MQL5_WRONG_PROPERTY:          return("Wrong identifier of the program property");
      case ERR_TERMINAL_WRONG_PROPERTY:      return("Wrong identifier of the terminal property");
      case ERR_FTP_SEND_FAILED:              return("File sending via ftp failed");
      case ERR_BUFFERS_NO_MEMORY:            return("Not enough memory for the distribution of indicator buffers");
      case ERR_BUFFERS_WRONG_INDEX:          return("Wrong indicator buffer index");
      case ERR_CUSTOM_WRONG_PROPERTY:        return("Wrong ID of the custom indicator property");
      case ERR_ACCOUNT_WRONG_PROPERTY:       return("Wrong account property ID");
      case ERR_TRADE_WRONG_PROPERTY:         return("Wrong trade property ID");
      case ERR_TRADE_DISABLED:               return("Trading by Expert Advisors prohibited");
      case ERR_TRADE_POSITION_NOT_FOUND:     return("Position not found");
      case ERR_TRADE_ORDER_NOT_FOUND:        return("Order not found");
      case ERR_TRADE_DEAL_NOT_FOUND:         return("Deal not found");
      case ERR_TRADE_SEND_FAILED:            return("Trade request sending failed");
      case ERR_INDICATOR_UNKNOWN_SYMBOL:     return("Unknown symbol");
      case ERR_INDICATOR_CANNOT_CREATE:      return("Indicator cannot be created");
      case ERR_INDICATOR_NO_MEMORY:          return("Not enough memory to add the indicator");
      case ERR_INDICATOR_CANNOT_APPLY:       return("The indicator cannot be applied to another indicator");
      case ERR_INDICATOR_CANNOT_ADD:         return("Error applying an indicator to chart");
      case ERR_INDICATOR_DATA_NOT_FOUND:     return("Requested data not found");
      case ERR_INDICATOR_WRONG_INDEX:        return("Wrong index of the requested indicator buffer");
      case ERR_INDICATOR_WRONG_PARAMETERS:   return("Wrong number of parameters when creating an indicator");
      case ERR_INDICATOR_PARAMETERS_MISSING: return("No parameters when creating an indicator");
      case ERR_INDICATOR_CUSTOM_NAME:        return("The first parameter in the array must be the name of the custom indicator");
      case ERR_INDICATOR_PARAMETER_TYPE:     return("Invalid parameter type in the array when creating an indicator");
      case ERR_BOOKS_CANNOT_ADD:             return("Depth Of Market can not be added");
      case ERR_BOOKS_CANNOT_DELETE:          return("Depth Of Market can not be removed");
      case ERR_BOOKS_CANNOT_GET:             return("The data from Depth Of Market can not be obtained");
      case ERR_BOOKS_CANNOT_SUBSCRIBE:       return("Error in subscribing to receive new data from Depth Of Market");
      case ERR_TOO_MANY_FILES:               return("More than 64 files cannot be opened at the same time");
      case ERR_WRONG_FILENAME:               return("Invalid file name");
      case ERR_TOO_LONG_FILENAME:            return("Too long file name");
      case ERR_CANNOT_OPEN_FILE:             return("File opening error");
      case ERR_FILE_CACHEBUFFER_ERROR:       return("Not enough memory for cache to read");
      case ERR_CANNOT_DELETE_FILE:           return("File deleting error");
      case ERR_INVALID_FILEHANDLE:           return("A file with this handle was closed, or was not opening at all");
      case ERR_WRONG_FILEHANDLE:             return("Wrong file handle");
      case ERR_FILE_NOTTOWRITE:              return("The file must be opened for writing");
      case ERR_FILE_NOTTOREAD:               return("The file must be opened for reading");
      case ERR_FILE_NOTBIN:                  return("The file must be opened as a binary one");
      case ERR_FILE_NOTTXT:                  return("The file must be opened as a text");
      case ERR_FILE_NOTTXTORCSV:             return("The file must be opened as a text or CSV");
      case ERR_FILE_NOTCSV:                  return("The file must be opened as CSV");
      case ERR_FILE_READERROR:               return("File reading error");
      case ERR_FILE_BINSTRINGSIZE:           return("String size must be specified, because the file is opened as binary");
      case ERR_INCOMPATIBLE_FILE:            return("A text file must be for string arrays, for other arrays - binary");
      case ERR_FILE_IS_DIRECTORY:            return("This is not a file, this is a directory");
      case ERR_FILE_NOT_EXIST:               return("File does not exist");
      case ERR_FILE_CANNOT_REWRITE:          return("File can not be rewritten");
      case ERR_WRONG_DIRECTORYNAME:          return("Wrong directory name");
      case ERR_DIRECTORY_NOT_EXIST:          return("Directory does not exist");
      case ERR_FILE_ISNOT_DIRECTORY:         return("This is a file, not a directory");
      case ERR_CANNOT_DELETE_DIRECTORY:      return("The directory cannot be removed");
      case ERR_NO_STRING_DATE:               return("No date in the string");
      case ERR_WRONG_STRING_DATE:            return("Wrong date in the string");
      case ERR_WRONG_STRING_TIME:            return("Wrong time in the string");
      case ERR_STRING_TIME_ERROR:            return("Error converting string to date");
      case ERR_STRING_OUT_OF_MEMORY:         return("Not enough memory for the string");
      case ERR_STRING_SMALL_LEN:             return("The string length is less than expected");
      case ERR_STRING_TOO_BIGNUMBER:         return("Too large number, more than ULONG_MAX");
      case ERR_WRONG_FORMATSTRING:           return("Invalid format string");
      case ERR_TOO_MANY_FORMATTERS:          return("Amount of format specifiers more than the parameters");
      case ERR_TOO_MANY_PARAMETERS:          return("Amount of parameters more than the format specifiers");
      case ERR_WRONG_STRING_PARAMETER:       return("Damaged parameter of string type");
      case ERR_STRINGPOS_OUTOFRANGE:         return("Position outside the string");
      case ERR_STRING_ZEROADDED:             return("0 added to the string end, a useless operation");
      case ERR_STRING_UNKNOWNTYPE:           return("ÍUnknown data type when converting to a string");
      case ERR_WRONG_STRING_OBJECT:          return("Damaged string object");
      case ERR_INCOMPATIBLE_ARRAYS:          return("Copying incompatible arrays. String array can be copied only to a string array, and a numeric array - in numeric array only");
      case ERR_SMALL_ASSERIES_ARRAY:         return("The receiving array is declared as AS_SERIES, and it is of insufficient size");
      case ERR_SMALL_ARRAY:                  return("Too small array, the starting position is outside the array");
      case ERR_ZEROSIZE_ARRAY:               return("An array of zero length");
      case ERR_NUMBER_ARRAYS_ONLY:           return("Must be a numeric array");
      case ERR_ONEDIM_ARRAYS_ONLY:           return("Must be a one-dimensional array");
      case ERR_SERIES_ARRAY:                 return("Timeseries cannot be used");
      case ERR_DOUBLE_ARRAY_ONLY:            return("Must be an array of type double");
      case ERR_FLOAT_ARRAY_ONLY:             return("Must be an array of type float");
      case ERR_LONG_ARRAY_ONLY:              return("Must be an array of type long");
      case ERR_INT_ARRAY_ONLY:               return("Must be an array of type int");
      case ERR_SHORT_ARRAY_ONLY:             return("Must be an array of type short");
      case ERR_CHAR_ARRAY_ONLY:              return("Must be an array of type char");
      default: if(err_code>=ERR_USER_ERROR_FIRST && err_code<ERR_USER_ERROR_LAST)
                                             return("User error "+string(err_code-ERR_USER_ERROR_FIRST));
     }
//---
   return("Unknown error");
  }
//+------------------------------------------------------------------+
 
Christian Linden #:

Das macht Sinn:

😉


Und wenn du dann auf der MQL5 Doku unter Returncodes schaust, steht da einfach nur 



Dein Ticket stimmt wohl nicht mehr, so einfach ist das 

 
Christian #:

😉


Und wenn du dann auf der MQL5 Doku unter Returncodes schaust, steht da einfach nur 



Dein Ticket stimmt wohl nicht mehr, so einfach ist das 

Nein, hatte ich ganz oben geschrieben, die Position wurde nie geschlossen.

 
Christian Linden #:

Nein, hatte ich ganz oben geschrieben, die Position wurde nie geschlossen.

Dann stimmt dein ticket/Id nicht.


Die Fehlermeldung ist ja eindeutig.

 
Christian #:

Dann stimmt dein ticket/Id nicht.


Die Fehlermeldung ist ja eindeutig.

das liegt vermutlich daran, dass der TS nur auf ein NettingKonto funktioniert?

Grund der Beschwerde: