How would I modify this script to place two orders with the same stop loss but different profit targets?
For example a 10 pip stop loss with first target of 12 pips and second target at 30 pips? I played with it but it I don’t seem to be able to get it working?
#property show_inputs
#include <stderror.mqh>
#include <stdlib.mqh>
//parameternya ini, input-nya ini
extern double LOT = 0.10;
extern double TP = 12.0;
extern double SL = 10.0;
double Poin;
//±-----------------------------------------------------------------+
//| Custom initialization function |
//±-----------------------------------------------------------------+
int init(){
if (Point == 0.00001) Poin = 0.0001;
else {
if (Point == 0.001) Poin = 0.01;
else Poin = Point;
}
return(0);
}
//±-----------------------------------------------------------------+
// +
//±-----------------------------------------------------------------+
int start()
{
RefreshRates();
while( IsTradeContextBusy() ) { Sleep(100); }
//----
int ticket=OrderSend(Symbol(),OP_BUY,LOT,Ask,3,Ask-SLPoin,Ask+TPPoin,“contest”,1,0,CLR_NONE);
OrderSend(Symbol(),OP_BUY,LOT,Ask,3,Ask-SLPoin,Ask+TPPoin,“contest”,2,0,CLR_NONE);
if(ticket<1)
{
int error=GetLastError();
Print("Error = ",ErrorDescription(error));
return;
}
//----
OrderPrint();
return(0);
}