Hey guys and gals,
This is my first EA but I am having trouble as it is not working. I made it out of a script, which works flawlessly. I followed some tutorials but I can't get it to work.
If anyone can help me out I'd be deeply appreciated! Anyways, thanks in advance and I wish you the best in this infinite journey into the world of FX.
Greetings from Mexico!!!
This is my first EA but I am having trouble as it is not working. I made it out of a script, which works flawlessly. I followed some tutorials but I can't get it to work.
If anyone can help me out I'd be deeply appreciated! Anyways, thanks in advance and I wish you the best in this infinite journey into the world of FX.
Greetings from Mexico!!!
Inserted Code
//+------------------------------------------------------------------+ //| Buy & Sell.mq4 | //| Copyright © 2009, Chano12 | //| [url]http://www.carlosruiz.com.mx[/url] | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, Chano12" #property link "[url]http://www.carlosruiz.com.mx[/url]" //---- input parameters extern bool Buy=true; extern bool Sell=true; extern int StopLoss=0; extern int TakeProfit=50; extern double Lots=0.1; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { int ticket; double point; //---- point=MarketInfo(Symbol(),MODE_POINT); //---- if(Sell==true) { ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,0,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Buy",0,0,CLR_NONE); if(ticket<=0) Print("Error = ",GetLastError()); else { Print("ticket = ",ticket); } } if(Buy==true) { ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,0,Ask-StopLoss*Point,Ask+TakeProfit*Point,"Sell",0,0,CLR_NONE); if(ticket<=0) Print("Error = ",GetLastError()); else { Print("ticket = ",ticket); } } //---- return(0); } //+------------------------------------------------------------------+