I'm workin on it...

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi guys,
I was wondering whether someone might quickly code up a script that will allow me to place a market order with a defined stop loss and take profit. I've included a feeble attempt below which doesn't seem to be working.
Any help would be fantastic
Martin
//| Buy.mq4 |
//+------------------------------------------------------------------+
#property copyright ""
#property link ""
#include
#include
double Lots=0.1;
int Slippage=3;
int TakeProfit=99;
int StopLoss=10;
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
double MyStopLoss=Ask-StopLoss*Point;
double MyTakeProfit=Ask+TakeProfit*Point;
//----
OrderPrint();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,MyStopLoss,MyTakeProfit,"Buy",0,0,CLR_NONE);
return(0);
}
//+------------------------------------------------------------------+