Mod needed to this code for ECN /STP gomarkets

To add comments, please log in or register
Rodney Comer
46
Rodney Comer  

Hi Gurus,

Im am learning this stuff. When I run this code which is part of an ea on other brokers its fine but Gomarkets doesn,t accept these entries on one order. i.e the Bid +stoploss+ and takeprofit.

Can someone please modify so it's sent in two sends... ? i.e bid then stoploss and take profit.

I'll learn a lot. many thanks

Rodney



//---- sell

if(ma1<ma2 && ma0<ma1 && Close[1]<ma0 && st>StochOverbought)
{
res=OrderSend(Symbol(),OP_SELL,Lots(),Bid,3,Bid+StopLoss,Bid-TakeProfit,"",MAGICMA,0,Red);
return;
}
//---- buy
if(ma1>ma2 && ma0>ma1 && Close[1]>ma0 && st<StochOversold)
{
res=OrderSend(Symbol(),OP_BUY,Lots(),Ask,3,Ask-StopLoss,Ask+TakeProfit,"",MAGICMA,0,Blue);
return;

}

//

qjol
3200
qjol  
Rodney Comer
46
Rodney Comer  
comerro1:

Hi Gurus,

Im am learning this stuff. When I run this code which is part of an ea on other brokers its fine but Gomarkets doesn,t accept these entries on one order. i.e the Bid +stoploss+ and takeprofit.

Can someone please modify so it's sent in two sends... ? i.e bid then stoploss and take profit.

I'll learn a lot. many thanks

Rodney



//---- sell

if(ma1<ma2 && ma0<ma1 && Close[1]<ma0 && st>StochOverbought)
{
res=OrderSend(Symbol(),OP_SELL,Lots(),Bid,3,Bid+StopLoss,Bid-TakeProfit,"",MAGICMA,0,Red);
return;
}
//---- buy
if(ma1>ma2 && ma0>ma1 && Close[1]>ma0 && st<StochOversold)
{
res=OrderSend(Symbol(),OP_BUY,Lots(),Ask,3,Ask-StopLoss,Ask+TakeProfit,"",MAGICMA,0,Blue);
return;

}

//




Rodney Comer
46
Rodney Comer  

Hi qjol,


Arrh thats way beyond me ...... Im sure it just ORDERMODIFY but don't see how it knows which one to modify?


Can you add the code to above

thx


Rodney

qjol
3200
qjol  

OrderSelect(ticket.....)

Rodney Comer
46
Rodney Comer  
qjol:

OrderSelect(ticket.....)



{

// original code was ----- res=OrderSend(Symbol(),OP_SELL,Lots(),Bid,3,Bid+StopLoss,Bid-TakeProfit,"",MAGICMA,0,Red);

// below trying to split out SL and TP into and ordermodify

res=OrderSend(Symbol(),OP_SELL,Lots(),Bid,3,,,"",MAGICMA,0,Red);

bool OrderModify(ticket,,Bid+StopLoss,Bid-TakeProfit,"",,);


return;

}

cheers...Rodney

qjol
3200
qjol  

bool OrderModify(res.....

Rodney Comer
46
Rodney Comer  
qjol:

bool OrderModify(res.....


Arh... starting to understand,

How do I not update existing values like price ?,, is not right and can't see in the book.


thx

qjol
3200
qjol  
comerro1:

Arh... starting to understand,

How do I not update existing values like price ?,, is not right and can't see in the book.


thx


BTW bool someting = OrderModify(res.....
Rodney Comer
46
Rodney Comer  
qjol:

BTW bool someting = OrderModify(res.....


// original ----- res=OrderSend(Symbol(),OP_SELL,Lots(),Bid,3,Bid+StopLoss,Bid-TakeProfit,"",MAGICMA,0,Red);
res=OrderSend(Symbol(),OP_SELL,Lots(),Bid,3,0,0,"",MAGICMA,0,Red);

bool OrderModify(res,Bid,Bid+StopLoss,Bid-TakeProfit,"",Red);

whats wrong with this ... OrderModify ...error .....variable expected... ?

qjol
3200
qjol  
comerro1:


// original ----- res=OrderSend(Symbol(),OP_SELL,Lots(),Bid,3,Bid+StopLoss,Bid-TakeProfit,"",MAGICMA,0,Red);
res=OrderSend(Symbol(),OP_SELL,Lots(),Bid,3,0,0,"",MAGICMA,0,Red);

bool OrderModify(res,Bid,Bid+StopLoss,Bid-TakeProfit,"",Red);

whats wrong with this ... OrderModify ...error .....variable expected... ?


OrderSelect(res, SELECT_BY_TICKET);
bool retrn = OrderModify(res, OrderOpenPrice(), Bid+StopLoss, Bid-TakeProfit, 0, Red);
or

OrderSelect(res, SELECT_BY_TICKET);

bool retrn = OrderModify(res, OrderOpenPrice(), Bid+StopLoss*Point, Bid-TakeProfit*Point, 0, Red);

12
To add comments, please log in or register