How can I reset my stoploss to -8 pips,just after loss reachs -15 pips.

 

I am using scalping ea.I want to reduce loss of false alert.

My ea is a version of mastermind 3(here in this forum).

it makes even in real account(2 pips fixed) X200 in year.

but sometimes goes bad to 1/2...

 

I mean for example my original stoploss is 20 pips.but if it reaches 15 pip I want it to set 8.........like trailing stop.

modifying stop loss..

-20...................

-18 => -11

-17 => -10

-16 => -9

-15 => -8

negative trailingstop is -7 for example.it reachs 17 I dont want to wait till it became positive or it comes -20.

ı dont know much about coding also.dont know how to use void comand..

here is original.trailing.and also I didnt understand "breakeven" in code.

//BreakEven routine
    if (BreakEven>0) {
      if ((pBid-OrderOpenPrice())>BreakEven*pp) {
         if ((OrderStopLoss()-OrderOpenPrice())<0) {
            ModifyStopLoss(OrderOpenPrice()+0*pp);
         }   
      }    
    }
    
    if (TrailingStop>0) {
    if ((pBid-OrderOpenPrice())>TrailingStop*pp) {
      if (OrderStopLoss()<pBid-(TrailingStop+TrailingStep-1)*pp) {
        ModifyStopLoss(pBid-TrailingStop*pp);
        return;
      }
    }
    }
 
  }
  if (OrderType()==OP_SELL) {
    pAsk = MarketInfo(OrderSymbol(), MODE_ASK);
 
    if (BreakEven>0) {
      if ((OrderOpenPrice()-pAsk)>BreakEven*pp) {
         if ((OrderOpenPrice()-OrderStopLoss())<0) {
            ModifyStopLoss(OrderOpenPrice()-0*pp);
          }
       }
    }
 
    if (TrailingStop>0) {
    if (OrderOpenPrice()-pAsk>TrailingStop*pp) {
      if (OrderStopLoss()>pAsk+(TrailingStop+TrailingStep-1)*pp || OrderStopLoss()==0) {
        ModifyStopLoss(pAsk+TrailingStop*pp);
        return;
      }
    }
    }
 
 
void Skip_SL_to_openprice()
{
if(Use_skip_SL_to_open_price == true)
{
OrderSelect(ticket,SELECT_BY_TICKET);

//BUY order: if price is above skip level -> SL = OrderOpenPrice
    if (OrderType() == OP_BUY && Bid > OrderOpenPrice()+Skip_SL_to_Open_price*Point)
     {
      SL = OrderOpenPrice();
      Alert("SL is set to open Price: ",SL);
     }
//SELL order: if price is below skip level -> SL = OrderOpenPrice
     if (OrderType() == OP_SELL && Ask < OrderOpenPrice()-Skip_SL_to_Open_price*Point)  
     {
      SL = OrderOpenPrice();  
      Alert("SL is set to open Price: ",SL);
     } 
}     
}    
 
I am getting chart error.and dont know what it means..
 
 
vieri3225:
I am getting chart error.and dont know what it means..
Can you copy and paste the exact error here please . .
 
bulduk1
AlpariUK-Demo (Build 402)

SembolEURUSD (Euro vs US Dollar)
Zaman aralığı5 Dakika (D5) 2010.07.08 09:00 - 2011.05.31 23:55 (2010.06.01 - 2011.06.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParametrelerShift1=0; Shift2=1; Shift3=2; Lots=1; StopLoss=100; TakeProfit=400; TradeAtCloseBar=true; TrailingStop=5; TrailingStep=1; BreakEven=0; MagicNumber=0; Repeat=3; Periods=5; UseAlert=false; SendEmail=true; TradeLog="MasterMind3"; Slippage=3; Indicator_Setting="---------- Indicator Setting"; Crash=false; TimeFrame=0; Length=5; Method=3; Smoothing=1; Filter=5; RealTime=true; Steady=false; Color=true; Alerts=true; EmailON=false; SignalPrice=true; SignalPriceBUY=Yellow; SignalPriceSELL=Aqua; CountBars=1485; BasketProfit=100000; BasketLoss=500000;
Barlar denemede65157Tikler modellenmiş11590161Modelling qualityn/a
Mismatched charts errors3326180
Başlangıç depozitosu1000.00
Toplam net kar92499.24Toplam kar334983.02Toplam zarar-242483.78
Profit factor1.38Expected payoff94.68
Absolute drawdown165.30En fazla düşüş (%)25472.40 (59.99%)Relative drawdown73.76% (7994.84)
Toplam işlem977Short positions (won %)493 (75.66%)Long positions (won %)484 (74.17%)
Profit trades (% of total)732 (74.92%)Zararlı işlemler(% olarak)245 (25.08%)
En büyükprofit trade7278.20loss trade-8177.00
Ortalamaprofit trade457.63loss trade-989.73
Maximumconsecutive wins (profit in money)28 (21703.30)consecutive losses (loss in money)6 (-370.00)
Maximalconsecutive profit (count of wins)36761.70 (21)consecutive loss (count of losses)-14017.00 (2)
Ortalamaconsecutive wins4consecutive losses1

 


SembolEURUSD (Euro vs US Dollar)
Zaman aralığı5 Dakika (D5) 2010.07.08 09:00 - 2011.05.31 23:55 (2010.06.01 - 2011.06.01)
Also time is incorrect.I ended it february 3rd..

 

Ah I see . . . you have bad data . . . download new data and import it.

Read this article carefully, it will help: http://www.jeremywhittaker.com/2010/12/28/setting-up-metatrader-for-better-backtesting-quality/

Reason: