Fan sayfamıza katılın
Öyleyse bir link gönderin -
başkalarının da faydalanmasını sağlayın
- Yayınlayan:
- Vladimir Karputov
- Görüntülemeler:
- 9725
- Derecelendirme:
- Yayınlandı:
- 2017.03.02 09:53
- Güncellendi:
- 2018.06.25 15:20
-
Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git
Two pending orders (BuyStop and SellStop) are placed with the specified expiration.
Author of the idea — John Smith, author of the MQL5 code — barabashkakvn.
Operation Start
Placing two pending orders:
Then we expect operation with only one position — if two positions are opened for any reason, both of them should be deleted:
if(total>1)
{
if(count_buy>1 || count_sell>1 || count_buy+count_sell>1)
{
CloseAllPositions(); // Close all positions if anything goes wrong
return; // Exit
}
}
Managing the open position.
First we check if minimum profit is reached. At the same time, the size of bar 1 must be less than "stabilization of points". If the condition is met, close the position and exit.
{
m_trade.PositionClose(m_position.Ticket());
DeleteOrders(ORDER_TYPE_SELL_STOP);
return;
}
Second check — checking simultaneously if absolute profit or loss is reached. If condition is met, close the position.
{
m_trade.PositionClose(m_position.Ticket());
DeleteOrders(ORDER_TYPE_SELL_STOP);
}
Results on EURUSD, H1 from 2016.06.01 to 2016.12.21:
MetaQuotes Ltd tarafından Rusçadan çevrilmiştir.
Orijinal kod: https://www.mql5.com/ru/code/17246

The Expert Advisor uses the values of two iMA (Moving Average, MA) indicators.

Uses two iStochastic (Stochastic Oscillator) indicators and one iRSI (RSI, Relative Strength Index). Calculates the lot size based on the analysis of closed trades.

The EA places pending stop orders BUY_STOP and SELL_STOP.

An example of working with the trading history on Hedge accounts — reconstruction of positions.