Einzelnen Beitrag anzeigen
  #1 (permalink)  
Alt 10.08.20
noSkill06s noSkill06s ist offline
Mitglied
 
Registriert seit: Aug 2020
Beiträge: 36
noSkill06s befindet sich auf einem aufstrebenden Ast
Standard OrderSend() 130 verzweifelt

Hallo Leute,

danke erstmal für dieses forum und eure Hilfe, habe ein "OrderSend()" problem error "130" habe fast alles mögliche probiert Auflistung:

1. Nur OrderSend() im Ontick (ohne Kontrollstruktur)
2. OrderSend() ohne variablen sonder mit zahlen sprich tp 100, sl 100
3. Neuer ExpertAdvisor nur OrderSend() Bar oben unten Long Short

aber bekomme immer wieder die gleiche Fehlermeldung 130 "invalid sl" wobei ich den stoploss sogar schon auf 1000 pips gesetzt habe.

mein Code:
Code:
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   //MESSAGE FOR SUCESSFUL LAUNCH
   Alert("Expert Advisor launched sucessful");
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   //MESSAGE FOR SUCESSFUL TERMINATION
   Alert("Expert Advisor terminated sucessful");
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+

//EXTERNAL USER INPUT
extern double    TakeProfit              = 1000;
extern double    StopLoss                = 1000;
extern int       Slippage                = 100;
extern double    MartingaleMultiplicator = 1.5;
extern double    LotSize                 = 1.0;



//TAKEPROFIT AND STOPLOSS RECALCULATION BROKER DECIMALS
double TakeProfitLevel = Bid + TakeProfit*Point;
double StopLossLevel   = Bid - StopLoss*Point;

//ORDERNUMBERS
int ticketLong;
int ticketShort;

/* CUSTOM CODE
//--- get minimum stop level
double minstoplevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
double price=Ask;
//--- calculated SL and TP prices must be normalized
double stoploss=NormalizeDouble(Bid-minstoplevel*Point,Digits);
double takeprofit=NormalizeDouble(Bid+minstoplevel*Point,Digits);
*/

void OnTick(){

   Alert("TakeProfitlevel: ", string(TakeProfitLevel));
   Alert("StopLossLevel: ", string(StopLossLevel));


   //PRESSVOLUME_A_V1 INITIAILISIERUNG ICUSTOM(SYMBOL, TIMEFRAME, NAMEINDICATOR, BUFFER, SHIFT); 
   int pressVolume_A_v1Long  = iCustom(NULL, PERIOD_CURRENT, "pressVolume_A_v1", 1, 0);
   int pressVolume_A_v1Short = iCustom(NULL, PERIOD_CURRENT, "pressVolume_A_v1", 2, 0);
   
   //LONG POSITION
   if(pressVolume_A_v1Long != EMPTY_VALUE && pressVolume_A_v1Long != 0){
      Alert("Long True");
      int ticketLong;
      ticketLong = OrderSend(Symbol(), OP_BUY, LotSize, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Long Order");
      if(ticketLong < 0){
         Alert("OrderSend Long error");
      } else {
         Alert("OrderSend Long sucessful");
      }
   }
   
   //SHORT POSITION
   if(pressVolume_A_v1Short != EMPTY_VALUE && pressVolume_A_v1Short != 0){
      Alert("Short True");
      int ticketShort;
      ticketShort = OrderSend(Symbol(), OP_SELL, LotSize, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Short Order");
      if(ticketShort < 0){
         Alert("OrderSend Short error");
      } else{
         Alert("OrderSend Short sucessful");
      }
   } 
  }
wäre sehr dankbar wenn mir einen tipp geben könnte wo ich einen Fehler habe, zusatzinfo bin newbie danke