//---- input parameters extern int period_ma=21; extern int period_adx=10; extern int filt=5; double muv; int t; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //----
//---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //----
//---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- if (OrdersTotal()==0) { muv=(iMA(Symbol(),PERIOD_M15,period_ma,0,MODE_LWMA,PRICE_CLOSE,1)-(High[1]-((High[1]-Low[1])/2)))*(-1)*100; double adx_main=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_MAIN,0); double adx_min=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_MINUSDI,0); double adx_plus=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_PLUSDI,0); if (muv<0 && MathAbs(muv)>0.1 && adx_main>adx_min && adx_min>adx_plus) { t=OrderSend(Symbol(),OP_SELL,0.1,Bid,3,NULL,NULL,"My order #",16384,0,Green); Print (GetLastError()); } }
if (OrdersTotal()>0) { if (muv>0) { OrderSelect(t,SELECT_BY_TICKET,MODE_TRADES); OrderClose(t,0.1,Ask,3,Red); Print (GetLastError()); } } return(0); } //+------------------------------------------------------------------+
異なるデータ型の集合を持つ配列を宣言 することは可能ですか?どうやら違うようだ。"テスト "問題...いわば
異なるデータ型の集合を持つ配列を宣言することは可能ですか?どうやら違うようだ。"テスト "問題...いわば
答えを確認してください。いいえ。
T1からT2まで、つまり指定された時間だけフクロウを働かせるにはどうしたらよいでしょうか?
指定された時間、つまりT1からT2までの間だけフクロウを動作させるにはどうしたらよいでしょうか?
T1からT2まで、指定した時間だけフクロウを動作させるには?
こちらも...>>「MetaEditor:テンプレートの力に頼る」。
何が問題なのか?
//+------------------------------------------------------------------+
//| ad+muv.mq4 |
//| Evgenio |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Evgenio"
#property link "http://www.metaquotes.net"
//---- input parameters
extern int period_ma=21;
extern int period_adx=10;
extern int filt=5;
double muv;
int t;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
if (OrdersTotal()==0)
{
muv=(iMA(Symbol(),PERIOD_M15,period_ma,0,MODE_LWMA,PRICE_CLOSE,1)-(High[1]-((High[1]-Low[1])/2)))*(-1)*100;
double adx_main=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_MAIN,0);
double adx_min=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_MINUSDI,0);
double adx_plus=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_PLUSDI,0);
if (muv<0 && MathAbs(muv)>0.1 && adx_main>adx_min && adx_min>adx_plus)
{
t=OrderSend(Symbol(),OP_SELL,0.1,Bid,3,NULL,NULL,"My order #",16384,0,Green);
Print (GetLastError());
}
}
if (OrdersTotal()>0)
{
if (muv>0)
{
OrderSelect(t,SELECT_BY_TICKET,MODE_TRADES);
OrderClose(t,0.1,Ask,3,Red);
Print (GetLastError());
}
}
return(0);
}
//+------------------------------------------------------------------+
はここで終了してください