Hilfe bei der Codierung - Seite 104

 

Vielen Dank Mladen .... Du bist großartig ...

 

Hallo Leute,

kann mir bitte jemand bei meiner Anfrage auf Seite 103 helfen? Ich habe im Internet nach Informationen gesucht, konnte aber nicht erreichen, dass der Alarm für alle 5 Takte ausgelöst wird (beginnend zu Beginn der Stunde).

Ich danke Ihnen im Voraus

 

Sehr geehrte Mladen/Herr Tools Können Sie bitte beheben diese ea, so dass es nicht wieder öffnen Handel einmal Stop oder tp getroffen wird.

Dateien:
 

Kodierungshilfe für Stop Loss

Hallo Leute,

ich habe diesen EA, bei dem ich den Stop Loss nicht ändern kann.

Egal was ich ändere, wird es nicht ändern. Ich würde gerne den Stop Loss auf mindestens 300 ändern. Hat jemand eine Idee?

Vielen Dank im Voraus

Dies ist der Code dafür:

// generische Benutzereingabe

extern double Lots=1.0;

extern int TakeProfit=44;

extern int StopLoss=90;

extern bool RSIMethodA=false;

extern bool RSIMethodB=true;

extern int RSIValue=50;

extern bool AbandonMethodA=true;

extern bool AbandonMethodB=false;

extern int Abandon=101;

extern bool MoneyManagement=true;

extern int Risiko=2;

extern int Slippage=3;

extern bool UseProfitLock=true;

extern int BreakEvenTrigger=25;

extern int BreakEven=3;

extern bool LiveTrading=false;

extern bool AccountIsMini=false;

extern int maxTradesPerPair=1;

extern int MagicNumber=5432;

double lotMM;

bool BuySignal=false;

bool SetBuy=false;

bool SellSignal=false;

bool SetSell=false;

// Behandlung von Balken

datetime bartime=0;

int bartick=0;

int TradeBars=0;

//+------------------------------------------------------------------+

//| Experten-Initialisierungsfunktion |

//+------------------------------------------------------------------+

int init()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| Experten-Deinitialisierungsfunktion |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start()

{

//----

wenn (UseProfitLock) ProfitLockStop();

if (AbandonMethodA || AbandonMethodB)

{

RunAbandonCheck();

RunAbandonMethods();

}

if (!SetLotsMM()) return(0);

RunOrderTriggerCalculations();

RunPairSpesificSettings();

RunNewOrderManagement();

//----

return(0);

}

/////////////////////////////////////////////////

// SetLotsMM - Von Robert Cochran http://autoforex.biz

/////////////////////////////////////////////////

bool SetLotsMM()

{

double MarginCutoff;

if(!AccountIsMini) MarginCutoff = 1000;

if( KontoIstMini) MarginCutoff = 100;

if(AccountFreeMargin() < MarginCutoff) return(false);

if(MoneyManagement)

{

lotMM = MathCeil(Kontostand() * Risiko / 10000) / 10;

if(lotMM < 0.1) lotMM = Lots;

if(lotMM > 1.0) lotMM = MathCeil(lotMM);

// Grenzen der Losgröße durchsetzen

if(LiveTrading)

{

if( AccountIsMini) lotMM = lotMM * 10;

if(!KontoIstMini && lotMM < 1.0) lotMM = 1.0;

}

if(lotMM > 100) lotMM = 100;

}

sonst

{

lotMM = Lots; // Ändern Sie MoneyManagement auf 0, wenn Sie möchten, dass der Parameter Lots wirksam ist

}

return(true);

}

//+------------------------------------------------------------------+

/////////////////////////////////////////////////

// RunOrderTriggerCalculations

/////////////////////////////////////////////////

bool RunOrderTriggerCalculations()

{

bool RSIPOS=false;

bool RSINEG=false;

// Gleitender 3-Perioden-Durchschnitt auf Bar[1]

double bullMA3=iMA(Symbol(),0,3,0,MODE_EMA,PRICE_CLOSE,1);

// 7-periodischer gleitender Durchschnitt auf Bar[1]

double bearMA7=iMA(Symbol(),0,7,0,MODE_EMA,PRICE_CLOSE,1);

// Gleitender 2-Perioden-Durchschnitt auf Bar[2]

double RSI=iRSI(Symbol(),0,2,PRICE_CLOSE,2);

double RSI2=iRSI(Symbol(),0,2,PREIS_SCHLIESSEN,1);

// Feststellen, welche Polarität der RSI hat

if (RSIMethodA)

{

if(RSI>RSIValue && RSI2<RSIValue)

{

RSIPOS=true;

RSINEG=false;

}

sonst RSIPOS=false;

if(RSIRSIValue)

{

RSIPOS=false;

RSINEG=true;

}

sonst RSINEG=false;

}

wenn (RSIMethodB)

{

if(RSI>RSIValue)

{

RSIPOS=true;

RSINEG=false;

}

if(RSI<RSIValue)

{

RSIPOS=false;

RSINEG=true;

}

}

wenn ((bullMA3 > (bearMA7+Point)) && RSINEG)

{

BuySignal=true;

}

sonst BuySignal=false;

wenn ((bullMA3 < (bearMA7-Punkt)) && RSIPOS)

{

SellSignal=true;

}

sonst SellSignal=false;

return(true);

}

/////////////////////////////////////////////////

// OpenOrdersBySymbolAndComment

/////////////////////////////////////////////////

int OpenOrdersForThisEA()

{

int ofts=0;

for(int x=0;x<OrdersTotal();x++)

{

OrderSelect(x, SELECT_BY_POS, MODE_TRADES);

if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)

{

ofts++;

}

}

return(ofts);

}

/////////////////////////////////////////////////

// PROFIT LOCK - Von Robert Cochran - http://autoforex.biz

/////////////////////////////////////////////////

bool ProfitLockStop()

{

if( OpenOrdersForThisEA() > 0 )

{

for ( int i = 0; i < OrdersTotal(); i++){

OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

//--- LANGE TRADES

if(OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber()== MagicNumber)

{

if (Bid >= OrderOpenPrice() + BreakEvenTrigger*Point &&

OrderOpenPrice() > OrderStopLoss())

{

OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice() + BreakEven * Point, OrderTakeProfit(), Green);

}

}

//--- LEERVERKÄUFE

if(OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber()==MagicNumber)

{

if (Ask <= OrderOpenPrice() - BreakEvenTrigger*Point &&

OrderOpenPrice() < OrderStopLoss())

{

OrderModify(OrderTicket(), OrderOpenPrice(),OrderOpenPrice() - BreakEven * Point, OrderTakeProfit(), Blue);

}

}

}

}

}

/////////////////////////////////////////////////

// PRÜFUNG AUFGEBEN

/////////////////////////////////////////////////

bool RunAbandonCheck()

{

if( OpenOrdersForThisEA() > 0 )

{

if (TradeBars == 0 && bartick == 0)

{

for (int i = 0; i < OrdersTotal(); i++)

{

if (OrderSymbol() == Symbol())

{

TradeBars = MathFloor(CurTime() - OrderOpenTime())/60/Period();

bartime = Time[0];

bartick = TradeBars;

}

}

}

if(bartime!=Time[0])

{

bartime=Time[0];

bartick++;

}

}

return(true);

}

/////////////////////////////////////////////////

// RunAbandonMethods

/////////////////////////////////////////////////

bool RunAbandonMethods()

{

if( OpenOrdersForThisEA() > 0 )

{

for (int i = 0; i < OrdersTotal(); i++)

{

OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

if (AbandonMethodA && bartick==Abandon)//Force "HEDGE" nach Abbruch

{

// LONG TRADES

if (OrderType() == OP_BUY && OrderSymbol() == Symbol() &&

OrderMagicNumber()==MagicNumber)

{

OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Blue);

SetSell=true;

fortfahren;

}

// LEERVERKÄUFE

if (OrderType() == OP_SELL && OrderSymbol() == Symbol() &&

OrderMagicNumber()==MagicNumber)

{

OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Blue);

SetBuy=true;

fortfahren;

}

}

if (AbandonMethodB && bartick==Abandon)//Indikatoren entscheiden Richtung nach Abbruch

{

// LONG TRADES

if (OrderType() == OP_BUY && OrderSymbol() == Symbol() &&

OrderMagicNumber()==MagicNumber)

{

OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,White);

fortfahren;

}

// SHORT TRADES

if (OrderType() == OP_SELL && OrderSymbol() == Symbol() &&

OrderMagicNumber()==MagicNumber)

{

OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,White);

fortfahren;

}

}

}

}

return(true);

}

/////////////////////////////////////////////////

// RunPairSpesificSettings

/////////////////////////////////////////////////

bool RunPairSpesificSettings()

{

// Einstellen der Symboloptimierungen

if (Symbol()=="GBPUSD")

{

TakeProfit=55; StopLoss=100; Abandon=69;

}

return(true);

}

/////////////////////////////////////////////////

// RunNewOrderManagement

/////////////////////////////////////////////////

bool RunNewOrderManagement()

{

double TP,SL;

if( OpenOrdersForThisEA() < maxTradesPerPair )

{

//ENTRY Ask(buy, long)

if (BuySignal || SetBuy)

{

SL = Ask - StopLoss*Punkt;

TP = Ask + TakeProfit*Point;

OrderSend(Symbol(),OP_BUY,lotMM,Ask,Slippage,SL,TP, "TS-ProfitLock - "+Symbol()+" - Long",MagicNumber,0,White);

bartick=0;

if (SetBuy) SetBuy=false;

return(true);

}

//ENTRY Bid (Verkaufen, Short)

wenn (SellSignal || SetSell)

{

SL = Bid + StopLoss*Point;

TP = Bid - TakeProfit*Point;

OrderSend(Symbol(),OP_SELL,lotMM,Bid,Slippage,SL,TP, "TS-ProfitLock - "+Symbol()+" - Short",MagicNumber,0,Red);

bartick=0;

if (SetSell) SetSell=false;

return(true);

}

}

return(true);

}

 
graphics:
Hallo Leute,

Ich habe diesen EA, den ich scheinbar nicht ändern kann, um den Stop Loss zu setzen.

Egal, was ich ändern, wird es nicht ändern. Ich möchte den Stop-Loss auf mindestens 300 ändern. Hat jemand eine Idee?

Vielen Dank im Voraus

Dies ist der Code dafür:

// generische Benutzereingabe

extern double Lots=1.0;

extern int TakeProfit=44;

extern int StopLoss=90;

extern bool RSIMethodA=false;

extern bool RSIMethodB=true;

extern int RSIValue=50;

extern bool AbandonMethodA=true;

extern bool AbandonMethodB=false;

extern int Abandon=101;

extern bool MoneyManagement=true;

extern int Risiko=2;

extern int Slippage=3;

extern bool UseProfitLock=true;

extern int BreakEvenTrigger=25;

extern int BreakEven=3;

extern bool LiveTrading=false;

extern bool AccountIsMini=false;

extern int maxTradesPerPair=1;

extern int MagicNumber=5432;

double lotMM;

bool BuySignal=false;

bool SetBuy=false;

bool SellSignal=false;

bool SetSell=false;

// Behandlung von Balken

datetime bartime=0;

int bartick=0;

int TradeBars=0;

//+------------------------------------------------------------------+

//| Experten-Initialisierungsfunktion |

//+------------------------------------------------------------------+

int init()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| Experten-Deinitialisierungsfunktion |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start()

{

//----

wenn (UseProfitLock) ProfitLockStop();

if (AbandonMethodA || AbandonMethodB)

{

RunAbandonCheck();

RunAbandonMethods();

}

if (!SetLotsMM()) return(0);

RunOrderTriggerCalculations();

RunPairSpesificSettings();

RunNewOrderManagement();

//----

return(0);

}

/////////////////////////////////////////////////

// SetLotsMM - Von Robert Cochran Willkommen autoforex.biz - BlueHost.com

/////////////////////////////////////////////////

bool SetLotsMM()

{

double MarginCutoff;

if(!AccountIsMini) MarginCutoff = 1000;

if( KontoIstMini) MarginCutoff = 100;

if(AccountFreeMargin() < MarginCutoff) return(false);

if(MoneyManagement)

{

lotMM = MathCeil(Kontostand() * Risiko / 10000) / 10;

if(lotMM < 0.1) lotMM = Lots;

if(lotMM > 1.0) lotMM = MathCeil(lotMM);

// Grenzen der Losgröße durchsetzen

if(LiveTrading)

{

if( AccountIsMini) lotMM = lotMM * 10;

if(!KontoIstMini && lotMM < 1.0) lotMM = 1.0;

}

if(lotMM > 100) lotMM = 100;

}

sonst

{

lotMM = Lots; // Ändern Sie MoneyManagement auf 0, wenn Sie möchten, dass der Parameter Lots wirksam ist

}

return(true);

}

//+------------------------------------------------------------------+

/////////////////////////////////////////////////

// RunOrderTriggerCalculations

/////////////////////////////////////////////////

bool RunOrderTriggerCalculations()

{

bool RSIPOS=false;

bool RSINEG=false;

// Gleitender 3-Perioden-Durchschnitt auf Bar[1]

double bullMA3=iMA(Symbol(),0,3,0,MODE_EMA,PRICE_CLOSE,1);

// 7-periodischer gleitender Durchschnitt auf Bar[1]

double bearMA7=iMA(Symbol(),0,7,0,MODE_EMA,PRICE_CLOSE,1);

// Gleitender 2-Perioden-Durchschnitt auf Bar[2]

double RSI=iRSI(Symbol(),0,2,PRICE_CLOSE,2);

double RSI2=iRSI(Symbol(),0,2,PREIS_SCHLIESSEN,1);

// Feststellen, welche Polarität der RSI hat

if (RSIMethodA)

{

if(RSI>RSIValue && RSI2<RSIValue)

{

RSIPOS=true;

RSINEG=false;

}

sonst RSIPOS=false;

if(RSIRSIValue)

{

RSIPOS=false;

RSINEG=true;

}

sonst RSINEG=false;

}

wenn (RSIMethodB)

{

if(RSI>RSIValue)

{

RSIPOS=true;

RSINEG=false;

}

if(RSI<RSIValue)

{

RSIPOS=false;

RSINEG=true;

}

}

wenn ((bullMA3 > (bearMA7+Point)) && RSINEG)

{

BuySignal=true;

}

sonst BuySignal=false;

wenn ((bullMA3 < (bearMA7-Punkt)) && RSIPOS)

{

SellSignal=true;

}

sonst SellSignal=false;

return(true);

}

/////////////////////////////////////////////////

// OpenOrdersBySymbolAndComment

/////////////////////////////////////////////////

int OpenOrdersForThisEA()

{

int ofts=0;

for(int x=0;x<OrdersTotal();x++)

{

OrderSelect(x, SELECT_BY_POS, MODE_TRADES);

if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)

{

ofts++;

}

}

return(ofts);

}

/////////////////////////////////////////////////

// PROFIT LOCK - Von Robert Cochran - Willkommen autoforex.biz - BlueHost.com

/////////////////////////////////////////////////

bool ProfitLockStop()

{

if( OpenOrdersForThisEA() > 0 )

{

for ( int i = 0; i < OrdersTotal(); i++){

OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

//--- LANGE TRADES

if(OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber()== MagicNumber)

{

if (Bid >= OrderOpenPrice() + BreakEvenTrigger*Point &&

OrderOpenPrice() > OrderStopLoss())

{

OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice() + BreakEven * Point, OrderTakeProfit(), Green);

}

}

//--- LEERVERKÄUFE

if(OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber()==MagicNumber)

{

if (Ask <= OrderOpenPrice() - BreakEvenTrigger*Point &&

OrderOpenPrice() < OrderStopLoss())

{

OrderModify(OrderTicket(), OrderOpenPrice(),OrderOpenPrice() - BreakEven * Point, OrderTakeProfit(), Blue);

}

}

}

}

}

/////////////////////////////////////////////////

// PRÜFUNG AUFGEBEN

/////////////////////////////////////////////////

bool RunAbandonCheck()

{

if( OpenOrdersForThisEA() > 0 )

{

if (TradeBars == 0 && bartick == 0)

{

for (int i = 0; i < OrdersTotal(); i++)

{

if (OrderSymbol() == Symbol())

{

TradeBars = MathFloor(CurTime() - OrderOpenTime())/60/Period();

bartime = Time[0];

bartick = TradeBars;

}

}

}

if(bartime!=Time[0])

{

bartime=Time[0];

bartick++;

}

}

return(true);

}

/////////////////////////////////////////////////

// RunAbandonMethods

/////////////////////////////////////////////////

bool RunAbandonMethods()

{

if( OpenOrdersForThisEA() > 0 )

{

for (int i = 0; i < OrdersTotal(); i++)

{

OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

if (AbandonMethodA && bartick==Abandon)//Zwingen von "HEDGE" nach Abbruch

{

// LONG TRADES

if (OrderType() == OP_BUY && OrderSymbol() == Symbol() &&

OrderMagicNumber()==MagicNumber)

{

OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Blue);

SetSell=true;

fortfahren;

}

// LEERVERKÄUFE

if (OrderType() == OP_SELL && OrderSymbol() == Symbol() &&

OrderMagicNumber()==MagicNumber)

{

OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Blue);

SetBuy=true;

fortfahren;

}

}

if (AbandonMethodB && bartick==Abandon)//Indikatoren entscheiden Richtung nach Abbruch

{

// LONG TRADES

if (OrderType() == OP_BUY && OrderSymbol() == Symbol() &&

OrderMagicNumber()==MagicNumber)

{

OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,White);

weiter;

}

// SHORT TRADES

if (OrderType() == OP_SELL && OrderSymbol() == Symbol() &&

OrderMagicNumber()==MagicNumber)

{

OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,White);

weiter;

}

}

}

}

return(true);

}

/////////////////////////////////////////////////

// RunPairSpesificSettings

/////////////////////////////////////////////////

bool RunPairSpesificSettings()

{

// Einstellen der Symboloptimierungen

if (Symbol()=="GBPUSD")

{

TakeProfit=55; StopLoss=100; Abandon=69;

}

return(true);

}

/////////////////////////////////////////////////

// RunNewOrderManagement

/////////////////////////////////////////////////

bool RunNewOrderManagement()

{

double TP,SL;

if( OpenOrdersForThisEA() < maxTradesPerPair )

{

//ENTRY Ask(buy, long)

if (BuySignal || SetBuy)

{

SL = Ask - StopLoss*Punkt;

TP = Ask + TakeProfit*Point;

OrderSend(Symbol(),OP_BUY,lotMM,Ask,Slippage,SL,TP, "TS-ProfitLock - "+Symbol()+" - Long",MagicNumber,0,White);

bartick=0;

if (SetBuy) SetBuy=false;

return(true);

}

//ENTRY Bid (Verkaufen, Short)

wenn (SellSignal || SetSell)

{

SL = Bid + StopLoss*Point;

TP = Bid - TakeProfit*Point;

OrderSend(Symbol(),OP_SELL,lotMM,Bid,Slippage,SL,TP, "TS-ProfitLock - "+Symbol()+" - Short",MagicNumber,0,Red);

bartick=0;

if (SetSell) SetSell=false;

return(true);

}

}

return(true);

}

StopLoss wird immer auf 100 gesetzt, wenn das Symbol GBPUSD ist.

Für andere sollte es funktionieren (außer, dass Sie den StopLoss bei 5-stelligen Brokern mit 10 multiplizieren sollten, da der EA mit Punkten und nicht mit Pips arbeitet)

 

Ich benutze es im Moment für USD/JPY und der Stop Loss bleibt immer noch bei 100.

Wo kann ich den Stop-Loss-Multiplikator finden?

 
graphics:
Ich verwende den Code derzeit für USD/JPY und der Stop-Loss bleibt immer noch bei 100. Wo finde ich den Stop-Loss-Multiplikator?

Stop Loss und Take Profit werden in diesem Teil festgelegt:

bool RunNewOrderManagement()

{

double TP,SL;

if( OpenOrdersForThisEA() < maxTradesPerPair )

{

//ENTRY Ask(buy, long)

if (BuySignal || SetBuy)

{

SL = Ask - StopLoss*Point;

TP = Ask + TakeProfit*Point;

OrderSend(Symbol(),OP_BUY,lotMM,Ask,Slippage,SL,TP ,"TS-ProfitLock - "+Symbol()+" - Long",MagicNumber,0,White);

bartick=0;

if (SetBuy) SetBuy=false;

return(true);

}

//ENTRY Bid (sell, short)

if (SellSignal || SetSell)

{

SL = Bid + StopLoss*Point;

TP = Bid - TakeProfit*Point;

OrderSend(Symbol(),OP_SELL,lotMM,Bid,Slippage,SL,T P,"TS-ProfitLock - "+Symbol()+" - Short",MagicNumber,0,Red);

bartick=0;

if (SetSell) SetSell=false;

return(true);

}

}

return(true);

}[/PHP]

As of stop loss that stays 100 : this part of code

[PHP]bool RunPairSpesificSettings()

{

// set up the symbol optimizations

if (Symbol()=="GBPUSD")

{

TakeProfit=55; StopLoss=100; Abandon=69;

}

return(true);

}

wird nur aktiviert, wenn das Symbol "GBPUSD" ist (wie es aus dem Code ersichtlich ist), so dass es nur in diesem Fall umkehrt. Überprüfen Sie Ihren Code noch einmal und suchen Sie nach 100 und Sie werden herausfinden, was mit Ihren Stop Losses los ist, denn in dem von Ihnen angehängten Code wird der Stop Loss nur im Falle von GBPUSD umgedreht.

 

Es immer noch nicht ändern Stop-Loss, auch wenn ich die Währungspaare auf die, die ich bin mit Handel ändern. Dieser EA wäre perfekt, wenn der Stop-Loss geändert werden könnte.

Vielen Dank für den Versuch, trotzdem zu helfen.

 

Hallo Coder,

Könnte jemand helfen, diesen Squeeze-Break-Indikator so zu modifizieren, dass er sowohl eine EMA-Bollinger-Band-Option als auch eine EMA-Keltner-Kanal-Option hat?

Danke :)

Dateien:
 
iwillsurvive:
Hallo Coder,

Könnte jemand helfen, diesen Squeeze-Break-Indikator so zu ändern, dass er sowohl eine EMA-Bollinger-Band-Option als auch eine EMA-Keltner-Kanal-Option hat?

Danke :)

Hallo Iwillsurvive, änderte den Indikator, so dass Sie eine Auswahl von ma's in der Keltner und Bollinger Bands haben, standardmäßig ist es auf EMA eingestellt.

Dateien:
Grund der Beschwerde: