佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1159|回复: 13

请问script 和 EA有什么分别?

[复制链接]
发表于 23-8-2009 04:27 PM | 显示全部楼层 |阅读模式
首先我要谢谢manchai。
请问script and EA 有什么分别?
请问以下是script还是EA?

//+------------------------------------------------------------------+
//|                                                Close All 1_0.mq4 |
//|                                          Copyright ?2007, Wolfe |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2007, Wolfe"
#property link      ""
extern double Stop_Loss=-200; //If open order dollar amount is < Stop_Loss value Close All will be executrd
extern double Take_Profit=200;//If open order dollar amount is > Take_Profit value Close All will be executed
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  
if ((AccountProfit() < Stop_Loss) || (AccountProfit() > Take_Profit))
{
while(OrdersTotal()>0)
{
OrderSelect(0,SELECT_BY_POS);
if(OrderType()==OP_BUY)
OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),999,Purple);
if(OrderType()==OP_SELL)
OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),999,Purple);
if(OrderType()==OP_BUYLIMIT||OrderType()==OP_BUYSTOP||OrderType()==OP_SELLLIMIT||OrderType()==OP_SELLSTOP)
OrderDelete(OrderTicket());
}
}

//----
   return(0);
  }
//+------------------------------------------------------------------+
回复

使用道具 举报


ADVERTISEMENT

发表于 23-8-2009 07:08 PM | 显示全部楼层
如果我没看错的话,这是ea。

int init()
  {
//----
//----
   return(0);
  }



int deinit()
  {
//----
   
//----
   return(0);
  }



mq4 的programming和一些普通的c programming 有些不同,但大致上syntax 还是一样的。

至于ea 和 script 有什么不同,我就不懂了。
回复

使用道具 举报

 楼主| 发表于 23-8-2009 11:00 PM | 显示全部楼层
谢谢您的意见,请问 if script 的code 放在 EA 里面或者 EA的 CODE 放在script里面,这还可以用吗?
回复

使用道具 举报

发表于 23-8-2009 11:46 PM | 显示全部楼层
回复

使用道具 举报

 楼主| 发表于 25-8-2009 12:52 PM | 显示全部楼层

回复 4# mancai 的帖子

谢谢您的资料。


OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),999,Purple);

请问上诉的 999,purple 是什么意思?
回复

使用道具 举报

发表于 25-8-2009 02:03 PM | 显示全部楼层
回复

使用道具 举报

Follow Us
 楼主| 发表于 25-8-2009 04:44 PM | 显示全部楼层

回复 6# mancai 的帖子

谢谢您的资料。


bool OrderClose( int ticket, double lots, double price, int slippage, color Color=CLR_NONE)
Closes opened order. If the function succeeds, the return value is true. If the function fails, the return value is false. To get the detailed error information, call GetLastError().
Parameters:
ticket   -   Unique number of the order ticket.
lots   -   Number of lots.
price   -   Preferred closing price.
slippage   -   Value of the maximum price slippage in points.
Color   -   Color of the closing arrow on the chart. If the parameter is missing or has CLR_NONE value closing arrow will not be drawn on the chart.

Sample:
  if(iRSI(NULL,0,14,PRICE_CLOSE,0)>75)
    {
     OrderClose(order_id,1,Ask,3,Red);
     return(0);
    }


我还是不明白这 slippage   -   Value of the maximum price slippage in points.

请各位指教
回复

使用道具 举报

发表于 25-8-2009 06:41 PM | 显示全部楼层
slippage是最大价格滑动值
当价格移动很快时,比如你要place order在1.5000
但你下单时价格飙到1.5005,5 pips,如果slippage 大过5就ok
slippage就是你容许的最大价格滑动值
回复

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 25-8-2009 07:32 PM | 显示全部楼层
谢谢mancai的解释。我明白了。
回复

使用道具 举报

发表于 26-8-2009 04:40 AM | 显示全部楼层
我的 script ,一时能够用,一时却毫无动静

到底是因为什么?
回复

使用道具 举报

发表于 26-8-2009 09:03 AM | 显示全部楼层
原帖由 eric^zai 于 26-8-2009 04:40 AM 发表
我的 script ,一时能够用,一时却毫无动静

到底是因为什么?


什么script?
回复

使用道具 举报

发表于 26-8-2009 01:10 PM | 显示全部楼层
几乎我下载的 script 都是一样

有 Pending Order , Buy/Sell , TS
回复

使用道具 举报

发表于 26-8-2009 01:49 PM | 显示全部楼层
原帖由 eric^zai 于 26-8-2009 01:10 PM 发表
几乎我下载的 script 都是一样

有 Pending Order , Buy/Sell , TS


EA还是script?
回复

使用道具 举报

发表于 26-8-2009 01:52 PM | 显示全部楼层
原帖由 mancai 于 26-8-2009 01:49 PM 发表


EA还是script?


都是 script
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 12-2-2025 06:12 PM , Processed in 0.135001 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表