下载MetaTrader 5
要添加评论,请登录注册
加入MQL5 Cloud Network。开始获取利润!
kockleong
13
kockleong 2009.11.05 18:24 

各位高手~

请你们给我一个可以参考的脚本~可以一次买卖不同的货币~还有包过Takeprofit的~

谢谢~~

lou
4
lou 2009.11.07 03:21  

路过,顶下

okwh
1629
okwh 2009.11.07 04:30  

参考帮助中的sendorder 函数。

一次买卖不同的货币? 你的一次是什么意思?

一次交易只能是: 一句代码,只能发送一种货币的一个交易指令,

不同的货币 需要使用多个句子 (最好间隔几秒种)

一个完整的交易包括很多个相关的步骤

WFBI
65
WFBI 2009.11.07 05:23  

你提出的问题是太简单了,不过你可以设置一个数组,来做组合货币对,不过要看你的判断进入条件了。

string pairs[] = { "EURUSDm","USDJPYm","GBPUSDm","USDCHFm","EURCHFm","AUDUSDm","USDCADm",
"NZDUSDm","EURGBPm","EURJPYm","GBPJPYm","CHFJPYm","GBPCHFm","EURAUDm",
"EURCADm","AUDCADm","AUDJPYm","NZDJPYm","AUDNZDm" };

bool CheckTradeList(string mTradeSymbol)
{
string myTradeSymbol = "";

myTradeSymbol=StringSubstr(mTradeSymbol,0,6);

if (myTradeSymbol=="AUDCAD" && TradeAUDCAD) return(true);
if (myTradeSymbol=="AUDJPY" && TradeAUDJPY) return(true);
if (myTradeSymbol=="AUDNZD" && TradeAUDNZD) return(true);
if (myTradeSymbol=="AUDUSD" && TradeAUDUSD) return(true);
if (myTradeSymbol=="CHFJPY" && TradeCHFJPY) return(true);
if (myTradeSymbol=="EURAUD" && TradeEURAUD) return(true);
if (myTradeSymbol=="EURCAD" && TradeEURCAD) return(true);
if (myTradeSymbol=="EURCHF" && TradeEURCHF) return(true);
if (myTradeSymbol=="EURGBP" && TradeEURGBP) return(true);
if (myTradeSymbol=="EURJPY" && TradeEURJPY) return(true);
if (myTradeSymbol=="EURUSD" && TradeEURUSD) return(true);
if (myTradeSymbol=="GBPCHF" && TradeGBPCHF) return(true);
if (myTradeSymbol=="GBPJPY" && TradeGBPJPY) return(true);
if (myTradeSymbol=="GBPUSD" && TradeGBPUSD) return(true);
if (myTradeSymbol=="NZDJPY" && TradeNZDJPY) return(true);
if (myTradeSymbol=="NZDUSD" && TradeNZDUSD) return(true);
if (myTradeSymbol=="USDCHF" && TradeUSDCHF) return(true);
if (myTradeSymbol=="USDJPY" && TradeUSDJPY) return(true);
if (myTradeSymbol=="USDCAD" && TradeUSDCAD) return(true);
return(false);
}还不理解的话请联系1031130533

kockleong
13
kockleong 2009.11.09 08:56  

我试写了这个脚本~

脚本的功能是:-

1。买卖9个货币在同一时间(9*2 = 18个)

2。止损放0,获利随意

问题:-

1。有的货币不能起动,要去到相关的货币才能起动。

2。止损放不到0


脚本

-------------------------------------------------------------------------------------------------------------------
#property copyright "Copyright ?2008, PRMQuotes Software Corp."

#include <stdlib.mqh>
#include <WinUser32.mqh>


extern double Lots = 0.10; // change this number to change the lotsize
extern double stoploss = 100; // change this number to change the stoploss
extern double takeprofit = 100; // change this number to change the takeprofit

int start()
{

OrderSend("EURUSD",OP_BUY,Lots,MarketInfo("EURUSD",MODE_ASK),3,MarketInfo("EURUSD",MODE_ASK)-50*Point,MarketInfo("EURUSD",MODE_ASK)+12*Point,"",0,0,Blue);
OrderSend("EURUSD",OP_SELL,Lots,MarketInfo("EURUSD",MODE_BID),3,MarketInfo("EURUSD",MODE_BID)+50*Point,MarketInfo("EURUSD",MODE_BID)-12*Point,"",0,0,Red);

OrderSend("USDCHF",OP_BUY,Lots,MarketInfo("USDCHF",MODE_ASK),3,MarketInfo("USDCHF",MODE_ASK)-50*Point,MarketInfo("USDCHF",MODE_ASK)+13*Point,"",0,0,Blue);
OrderSend("USDCHF",OP_SELL,Lots,MarketInfo("USDCHF",MODE_BID),3,MarketInfo("USDCHF",MODE_BID)+50*Point,MarketInfo("USDCHF",MODE_BID)-13*Point,"",0,0,Red);

OrderSend("USDJPY",OP_BUY,Lots,MarketInfo("USDJPY",MODE_ASK),3,MarketInfo("USDJPY",MODE_ASK)-50*Point,MarketInfo("USDJPY",MODE_ASK)+12*Point,"",0,0,Blue);
OrderSend("USDJPY",OP_SELL,Lots,MarketInfo("USDJPY",MODE_BID),3,MarketInfo("USDJPY",MODE_BID)+50*Point,MarketInfo("USDJPY",MODE_BID)-12*Point,"",0,0,Red);

OrderSend("AUDUSD",OP_BUY,Lots,MarketInfo("AUDUSD",MODE_ASK),3,MarketInfo("AUDUSD",MODE_ASK)-50*Point,MarketInfo("AUDUSD",MODE_ASK)+13*Point,"",0,0,Blue);
OrderSend("AUDUSD",OP_SELL,Lots,MarketInfo("AUDUSD",MODE_BID),3,MarketInfo("AUDUSD",MODE_BID)+50*Point,MarketInfo("AUDUSD",MODE_BID)-13*Point,"",0,0,Red);

OrderSend("GBPUSD",OP_BUY,Lots,MarketInfo("GBPUSD",MODE_ASK),3,MarketInfo("GBPUSD",MODE_ASK)-50*Point,MarketInfo("GBPUSD",MODE_ASK)+13*Point,"",0,0,Blue);
OrderSend("GBPUSD",OP_SELL,Lots,MarketInfo("GBPUSD",MODE_BID),3,MarketInfo("GBPUSD",MODE_BID)+50*Point,MarketInfo("GBPUSD",MODE_BID)-13*Point,"",0,0,Red);

OrderSend("EURJPY",OP_BUY,Lots,MarketInfo("EURJPY",MODE_ASK),3,MarketInfo("EURJPY",MODE_ASK)-50*Point,MarketInfo("EURJPY",MODE_ASK)+13*Point,"",0,0,Blue);
OrderSend("EURJPY",OP_SELL,Lots,MarketInfo("EURJPY",MODE_BID),3,MarketInfo("EURJPY",MODE_BID)+50*Point,MarketInfo("EURJPY",MODE_BID)-13*Point,"",0,0,Red);

OrderSend("CHFJPY",OP_BUY,Lots,MarketInfo("CHFJPY",MODE_ASK),3,MarketInfo("CHFJPY",MODE_ASK)-50*Point,MarketInfo("CHFJPY",MODE_ASK)+14*Point,"",0,0,Blue);
OrderSend("CHFJPY",OP_SELL,Lots,MarketInfo("CHFJPY",MODE_BID),3,MarketInfo("CHFJPY",MODE_BID)+50*Point,MarketInfo("CHFJPY",MODE_BID)-14*Point,"",0,0,Red);

OrderSend("AUDJPY",OP_BUY,Lots,MarketInfo("AUDJPY",MODE_ASK),3,MarketInfo("AUDJPY",MODE_ASK)-50*Point,MarketInfo("AUDJPY",MODE_ASK)+16*Point,"",0,0,Blue);
OrderSend("AUDJPY",OP_SELL,Lots,MarketInfo("AUDJPY",MODE_BID),3,MarketInfo("AUDJPY",MODE_BID)+50*Point,MarketInfo("AUDJPY",MODE_BID)-16*Point,"",0,0,Red);

OrderSend("GBPJPY",OP_BUY,Lots,MarketInfo("GBPJPY",MODE_ASK),3,MarketInfo("GBPJPY",MODE_ASK)-50*Point,MarketInfo("GBPJPY",MODE_ASK)+17*Point,"",0,0,Blue);
OrderSend("GBPJPY",OP_SELL,Lots,MarketInfo("GBPJPY",MODE_BID),3,MarketInfo("GBPJPY",MODE_BID)+50*Point,MarketInfo("GBPJPY",MODE_BID)-17*Point,"",0,0,Red);

}

-------------------------------------------------------------------------------------------------------

请高手们帮帮小弟~

帮我改改~

附加的文件:
xfxyldj
172
xfxyldj 2009.11.09 10:07  
可能要打开所有要交易货币兑的图表窗口(不需要挂EA),9个货币兑就要先开9个图表。你试试!
kockleong
13
kockleong 2009.11.09 11:45  
xfxyldj 写� >>
可能要打开所有要交易货币兑的图表窗口(不需要挂EA),9个货币兑就要先开9个图表。你试试!


我开了可以~

谢谢你~

如果不要开完可以吗?有什么方法?

zhimadog
86
zhimadog 2009.11.12 17:51  

不用打开吧。不会有问题的啊。

不开仓就一定有ERROR出现。

清一下ERROR就好了

/
要添加评论,请登录注册