記事"ヘッジ Expert Advisor コーディングの基礎"についてのディスカッション

 

新しい記事 ヘッジ Expert Advisor コーディングの基礎 はパブリッシュされました:

ヘッジ Expert Advisor の例が本稿で提供されたばかりです。私は個人的に好むヘッジペアを選びます。EURJPY と GBPJPY です。それはつねに同じように変動し、ヘッジングオーダータイプの設定が簡単なものです。

ステップ1:入力パラメータ

ヘッジ EA を書き始める前にまず相関シンボルを2つ選ぶ必要があります。それが以下です。

  • つねに同様に変動するGBPUSD と EURUSD
  • つねに逆に変動するGBPUSD と EURUSD
  • * など。

本稿では、私が個人的に好むヘッジペアを選択します。それは EURJPY と GBPJPY です。それはつねに同じように変動し、ヘッジングオーダータイプの設定が簡単なものです。それでは始めましょう。ヘッジ EA の作成を始めるにあたり、以下の入力変数について学習します。


// this is to block the order sending function but 
// not to block the close function.
extern bool BlockOpening = false; 
 
extern string BaseSymbol = "EURJPY";//the 1st symbol 
 
extern string H_Symbol = "GBPJPY";//the 2nd symbol 
 
extern bool MoveSameWay = true;//they move the same way or not 
 
extern int CorPeriod = 5;//your favorite correlation period 
 
extern double BaseLotSize = 1.5;//1st symbol lotsize 
 
extern double H_LotsSize = 1.0;//2nd symbol lotsize 
 
extern double ExpectProfit$ = 137;//your expect profit in USD 
//your acceptable loss in USD in case any error occurred 
extern double AcceptableLoss$ = -77; 
 
extern string ExpectCor = "______";//your expect correlation to hedge 
//this is the upper expect cor value and has to be greater than "And" 
extern double Between = 1.05; 
 
extern double And = 0.9;//this is the lower expect cor level 
 
extern string MISC = "______";//some thing more 
 
extern int MagicNo = 318;//your favorite magic number 
 
extern bool ShowStatus = true;//to show the present hedging status 
//to play sound when SendH and CloseH function done 
extern bool PlayAudio = false;

作者: chayutra sriboonruang