このビデオでは、ここから特定の取引戦略のビットを実装しようとしています
http://forextradingegies4u.com/20-sm...x-trading-egy/。この戦略は、単純移動平均とキャンドル価格に関連しています。このビデオでは、上の方針に従って下降トレンドまたは上向きトレンドを定義するためにif elseステートメントを作成する方法を示します。挿入されたビデオ
null挿入されたコード// --------------------------------------------- --------------------- /| Tutorial2.mq4 |/| Copyright 2017、MetaQuotes Software Corp. |/| https://www.mql5.com |/ ----------------------------------------------- ------------------- #property copyright Copyright 2017、MetaQuotes Software Corp. #property link https://www.mql5.com #property version 1.00 #property strict#プロパティindior_chart_window/ --------------------------------------------- --------------------- /|カスタムインジケータ初期化関数|/ ----------------------------------------------- ------------------- int OnInit(){//---インジケータバッファのマッピングPrint(チュートリアル2の初期化);/--- return(INIT_SUCCEEDED); }/ ---------------------------------------------- -------------------- /|カスタムインジケータ反復関数|/ ----------------------------------------------- ------------------- int OnCalculate(const int rates_total、const int prev_calculated、const datetime time#91;#93; const double open#91;#93; #93 ;;#93;#93 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;있고; 、const int spread#91;#93;){//---/価格データ型はDOUBLE double candleClose = iClose(Symbol()、PERIOD_CURRENT、0);ダブルsma = iMA(記号()、PERIOD_CURRENT、20,0、MODE_SMA、PRICE_CLOSE、0);印刷(sma =、sma);印刷(candleClose =、candleClose); if(candleCloselt; sma){//減価償却条件印刷(下降); } else if(candleClosegt; sma){//上り坂の状態Print(uptrend); }/---次の呼び出しのためにprev_calculatedの戻り値return(rates_total); }/ ---------------------------------------------- --------------------