거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
조회수:
2226
평가:
(13)
게시됨:
2018.10.25 15:57
\MQL5\Include\ \MQL5\Indicators\
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

The trading system based on the Iin_MA_Signal indicator signals with an ability to change the volume of a forthcoming trade depending on the results of the previous trades for this trading system. Trading signals are formed when a bar closes if a trend has changed (which is displayed by the indicator color label).

The block of input EA variables is added for managing volumes of opened positions:

input uint    BuyTotalMMTriger=5; // The number of the last Buy deals to calculate stop loss
input uint    BuyLossMMTriger=3;  // The number of losing Buy deals to reduce MM
input uint    SellTotalMMTriger=5;// The number of the last Sell deals to calculate stop loss
input uint    SellLossMMTriger=3; // The number of losing Sell deals to reduce MM
input double  SmallMM_=0.01;      // Share of a deposit in a deal in case of loss
input double  MM=0.1;             // Share of a deposit in a deal during normal trading
input MarginMode MMMode=LOT;      // Lot value determining method

In case of such inputs and when selecting from the last five trades, three of which are loss-making in a single direction, the EA opens the next trade in the same direction having the volume of 0.01 lot. If there are less than three loss-making trades out of the last five ones, the position volume is 0.1.

This EA is a further refining of the Exp_Iin_MA_Signal EA. The block of EA inputs has been added to the code and the position opening/closing block has been changed:

//---- Deal execution
//---- Closing a long position by magic number
   BuyPositionClose_M(BUY_Close,Symbol(),Deviation_,BuyMagic);

//---- Closing a short position by magic number  
   SellPositionClose_M(SELL_Close,Symbol(),Deviation_,SellMagic);

   double mm;
//---- Opening a long position by magic number
   if(BUY_Open)
     {
      mm=BuyTradeMMRecounterS(BuyMagic,BuyTotalMMTriger,BuyLossMMTriger,SmallMM_,MM); // define the long position volume depending on the results of previous deals
      BuyPositionOpen_M1(BUY_Open,Symbol(),UpSignalTime,mm,MMMode,Deviation_,StopLoss_,TakeProfit_,BuyMagic);
     }

//---- Opening a long position by magic number
   if(SELL_Open)
     {
      mm=SellTradeMMRecounterS(SellMagic,SellTotalMMTriger,SellLossMMTriger,SmallMM_,MM); // define the short position volume depending on the results of previous deals
      SellPositionOpen_M1(SELL_Open,Symbol(),DnSignalTime,mm,MMMode,Deviation_,StopLoss_,TakeProfit_,SellMagic);
     }

For the generated EA to operate correctly, the compiled Iin_MA_Signal.ex5 indicator file should be available in the <terminal_data_directory>\MQL5\Indicators folder.

Default Expert Advisor's input parameters without stops have been used during tests shown below.

Fig. 1. Examples of trades on the chart

Fig. 1. Examples of trades on the chart

GBPJPY H1 testing results over the year of 2017:

Fig. 2. Test results chart

Fig. 2. Test results chart

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/21969

Iin_MA_Signal_NRTR Iin_MA_Signal_NRTR

Iin_MA_Signal indicator in NRTR form

AMA Trader AMA Trader

Trading strategy based on iAMA (Adaptive Moving Average, AMA) and iRSI (Relative Strength Index, RSI) indicators. Martingale is applied.

XRSI_Histogram_Vol_Direct_HTF XRSI_Histogram_Vol_Direct_HTF

XRSI_Histogram_Vol_Direct indicator with the timeframe selection option available in input parameters

XCCI_Histogram_Vol_Direct_HTF XCCI_Histogram_Vol_Direct_HTF

XCCI_Histogram_Vol_Direct indicator with the timeframe selection option available in input parameters