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.
-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 . .
I am getting chart error.and dont know what it means..
Strategy Tester Report
bulduk1
AlpariUK-Demo (Build 402)
Sembol | EURUSD (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) | ||||
Model | Every tick (the most precise method based on all available least timeframes) | ||||
Parametreler | Shift1=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 denemede | 65157 | Tikler modellenmiş | 11590161 | Modelling quality | n/a |
Mismatched charts errors | 3326180 | ||||
Başlangıç depozitosu | 1000.00 | ||||
Toplam net kar | 92499.24 | Toplam kar | 334983.02 | Toplam zarar | -242483.78 |
Profit factor | 1.38 | Expected payoff | 94.68 | ||
Absolute drawdown | 165.30 | En fazla düşüş (%) | 25472.40 (59.99%) | Relative drawdown | 73.76% (7994.84) |
Toplam işlem | 977 | Short 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ük | profit trade | 7278.20 | loss trade | -8177.00 | |
Ortalama | profit trade | 457.63 | loss trade | -989.73 | |
Maximum | consecutive wins (profit in money) | 28 (21703.30) | consecutive losses (loss in money) | 6 (-370.00) | |
Maximal | consecutive profit (count of wins) | 36761.70 (21) | consecutive loss (count of losses) | -14017.00 (2) | |
Ortalama | consecutive wins | 4 | consecutive losses | 1 |
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/
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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...