|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Quote:
OrderSend(NULL, 0.... ) "NULL" specifies the pair for the order. Null means the current pair. You can put any string (that corresponds to a pair, such as GBPUSD) in there.
__________________
"Don't work harder, work smarter." -- my Java professor Coder for Hire: http://www.firecell-fx.com |
|
||||
|
Quote:
![]()
__________________
"Don't work harder, work smarter." -- my Java professor Coder for Hire: http://www.firecell-fx.com |
|
|||
|
Try something like the code posted below:
Code:
extern double Lots1=0.2;
extern double Lots2=0.1;
extern int StopLoss =50;
extern int TakeProfit=100;
int Slippage= 3;
int MagicNumber =123;
bool MySignal=false;
string Symbol1,Symbol2;
double orderprice;
int start()
{
Symbol1="USDCHF", Symbol2="GBPUSD"; //remember to put an "m" in if
//using an Interbankfx mini account, like "GBPUSDm"
if (MySignal==true)
{
if(IsTradeAllowed()==true)
{
sl=StopLoss*MarketInfo(Symbol1,MODE_POINT):
tp=TakeProfit*MarketInfo(Symbol1,MODE_POINT):
orderprice=MarketInfo(Symbol1,MODE_ASK);
OrderSend(Symbol1,OP_BUY,Lots1,orderprice,Slippage,orderprice-sl,orderprice+tp,"",MagicNumber,0,Blue);
}
{
sl=StopLoss*MarketInfo(Symbol2,MODE_POINT):
tp=TakeProfit*MarketInfo(Symbo2,MODE_POINT):
orderprice=MarketInfo(Symbol2,MODE_ASK);
OrderSend(Symbol2,OP_BUY,Lots2,orderprice,Slippage,orderprice-sl,orderprice+tp,"",MagicNumber,0,Blue);
}
return(0);
}
}
Last edited by dermusic : 05-21-2007 at 09:23 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Please Help In Programming Ea | Goen | Questions | 0 | 05-04-2007 07:18 PM |
| Programming My First EA - - - ???? | resalin | Setup Questions | 4 | 05-03-2007 03:06 PM |
| programming problem...! | gigiyoffee | Metatrader 4 | 2 | 05-01-2007 06:36 PM |
| programming Problem | munait | Metatrader 4 | 3 | 03-06-2006 09:45 AM |