ผมลองเขียนครั้งเเรกนะครับ คำสั่งเเบบ ที่ admin ยกตัวอย่างในบทที่9 ของ introductrion (ma7,ma14,ma30ฯ) ผมเขียนตามนี้ เเล้วcompiles ออกมามัน error อยู่7จุด ของความกรุณาadmin ช่วยเเนะนำด้วยครับมันผิดตรงไหน
//+------------------------------------------------------------------+
//| test ima().mq4 |
//| Copyright ฉ 2010, MetaQuotes Software Corp. |
//|
http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ฉ 2010, MetaQuotes Software Corp."
#property link "
http://www.metaquotes.net"
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
double ma7,ma14,ma30;//
int total;//
int ticket;//
ma7= iMA(NULL,0,7,8,MODE_SMMA,PRICE_MEDIAN,0);//
ma14=iMA(NULL,0,14,8,MODE_SMMA,PRICE_MEDIAN,0);//
ma30=iMA(NULL,0,30,8,MODE_SMMA,PRICE_MEDIAN,0);//
total=OrdersTotal();//
if(total<1)//
}
if(Ask>ma7>ma14>ma30)//
{
ticket=OrderSend(Symbol()OP_BUY,0.1,Ask,3,Bid-Point*500,Ask+Point*50,"firstea",0,0,Green);
OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES);//
}
if(Bid<ma7<ma14<ma30)
{
ticket=OrderSend(Symbol()OP_SELL,0.1,Bid,3,Ask+Point*500,Bid-Point*50,"firstea",0,0,Red);
OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES);//
}
}}
//----
return(0);
}
//+------------------------------------------------------------------+