無料でロボットをダウンロードする方法を見る
Telegram上で私たちを見つけてください。
私たちのファンページに参加してください
興味深いスクリプト?
それではリンクにそれを投稿してください。-
他の人にそれを評価してもらいます
記事を気に入りましたか?MetaTrader 5ターミナルの中でそれを試してみてください。
ライブラリ

LotsRisk - MetaTrader 4のためのライブラリ

ビュー:
8990
評価:
(12)
パブリッシュ済み:
2008.11.18 09:22
アップデート済み:
2016.04.05 14:49
\MQL4\Include\
このコードに基づいたロボットまたはインジケーターが必要なら、フリーランスでご注文ください フリーランスに移動

Parameters:

  • riskPercent - percent of the current balance you want to risk
  • sl - the value of the StopLoss for the given order
  • price - the open price of the order
  • error - refereced parameter. an error code, that is returned by the function

Note: I can't say that it works correctly. I've checked it approximately. So your comments are appreciated.

Here is an example:


   int riskPercentage = 3,
      error;
   double sl = Ask - 40 * Point,
      openPrice = Ask;   

   double lots = GetNeccessaryLotsWithRisk(riskPercentage, sl, openPrice, error);
   
   if (CompareDoubles(lots, 0))
   {
      switch (error)
      {
         case LOTS_TOO_BIG:   // lots are bigger than max lots
            Alert("Risk percentage is too big");
            break;

         case LOTS_TOO_SMALL: // lots are smaller than min lots
            Alert("Risk percentage is too small");
            break;

         default:             // formula's result =)
            Alert("It seems like you've got $0 or stoploss is too far");
            break;
      }
   }

MetaQuotes Ltdによってロシア語から翻訳されました。
元のコード: https://www.mql5.com/ru/code/8568

mysqlerror.mqh mysqlerror.mqh

A library of MySQL 5.0 error codes If you use a connection to the MySQL database in your EA, indicator or script and it doesn't work or something goes wrong then this library will allow you to find out what error is returned by the MySQL database.

MTS Neural network plus MACD MTS Neural network plus MACD

A variation on the Neuro nets topic: The trading system based on the interaction of the MACD indicator and a double-layer neuro net.

Indicator Volumes Buy-Sell Indicator Volumes Buy-Sell

This indicator signal buys and sell in the market.

Lagrange's Interpolation Polynomial Lagrange's Interpolation Polynomial

The application of Lagrange's interpolation polynomial at FOREX.