hier mal ein Beispiel (allerdings habe ich die Hochzählung der Perioden noch nicht korrekt, hat da jemand einen Tipp?)
Code:
int BUY_SL_Perioden = 50;
int SELL_SL_Perioden = 50;
double MIN_StopLoss_Abstand = 20;
double BUY_StopLoss_Pkt = MarketInfo(Symbol(),MODE_STOPLEVEL);
double SELL_StopLoss_Pkt = MarketInfo(Symbol(),MODE_STOPLEVEL);
if(BUY_StopLoss_Pkt<Preisband_Diff)
{
BUY_SL_Perioden++;
BUY_StopLoss_Pkt = (Bid-Low[iLowest(Symbol(),_Period,MODE_LOW,BUY_SL_Perioden,2)])*MarketInfo(Symbol(),MODE_LOTSIZE);
};
if(SELL_StopLoss_Pkt<Preisband_Diff)
{
SELL_SL_Perioden++;
SELL_StopLoss_Pkt = (High[iHighest(Symbol(),_Period,MODE_HIGH,SELL_SL_Perioden,2)]-Ask)*MarketInfo(Symbol(),MODE_LOTSIZE);
};