Sorry to have to ask but this is driving me up the wall.
What i want to eventually want to do is to buy 1 lot of EURUSD and at the same time SELL 1 lot of GBPUSD by just double clicking a script whilst a chart of EURUSD is open.
I know i have to use the market info command and the buy command works.
When i try to add the sell part it doesnt. I have stripped it right down to the point where i am just trying to sell at market price the GBPUSD on a EURUSD chart and i have this
//+------------------------------------------------------------------+
//| sell.mq4 |
//| Copyright © 2008, MetaQuotes Software Corp. |
//|
Forex Trading Software: Forex Trading Platform MetaTrader 4 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#include <stdlib.mqh>
#include <WinUser32.mqh>
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
int ticket=OrderSend("GBPUSD",OP_SELL,1,MarketInfo("GB PUSD",MODE_BID),0,"expert comment",255,0,CLR_NONE);
if(ticket<1)
{
int error=GetLastError();
Print("Error = ",ErrorDescription(error));
return;
}
//----
OrderPrint();
return(0);
}
Would someone be kind enough to tell me what i am doing wrong
Thanks Paul