Open 2 stoporders together

 

can someone help me to write this command.

@ cross open buystop @ 10pips above ask and open sellstop @ 10pips below bid

thx

 
iliaazshareef:
can someone help me to write this command.

@ cross open buystop @ 10pips above ask and open sellstop @ 10pips below bid

thx

Hello iliaazshareef,

say the golden cross you have been waiting for is triggered

now you could do this.

--- your code ---

Here with other variables

------------------

double BuyStop;

double SellStop;

double Bsl; // this is for the buy stoploss

double Ssl; // this is for the sell stoploss

double Btp;// this is for the buy tp

double Stp;// this is for the sell tp

// lets do buy .

BuyStop = Ask+10*Point;

Bsl = BuyStop - (your StopLoss * Point);

Btp = BuyStop + Btp * Point;

--- now --

OrderSend(Symbol(),OP_BUYSTOP,Lots,3,Bsl,Btp,"",0,0,CLR_NONE);

--------------------------------------

and for sell would be

SellStop = Bid-10*Point;

Ssl = SellStop+(yourStopLoss*Point);

Stp = SellStop + Stp * Point;

OrderSend(Symbol(),OP_SELLSTOP,Lots,3,Ssl,Stp,"",0,0,CLR_NONE);

-----------------------------------------------------

This is one way i could come up with.

regards

EACAN,

 
EACAN:
Hello iliaazshareef,

say the golden cross you have been waiting for is triggered

now you could do this.

--- your code ---

Here with other variables

------------------

double BuyStop;

double SellStop;

double Bsl; // this is for the buy stoploss

double Ssl; // this is for the sell stoploss

double Btp;// this is for the buy tp

double Stp;// this is for the sell tp

// lets do buy .

BuyStop = Ask+10*Point;

Bsl = BuyStop - (your StopLoss * Point);

Btp = BuyStop + Btp * Point;

--- now --

OrderSend(Symbol(),OP_BUYSTOP,Lots,3,Bsl,Btp,"",0,0,CLR_NONE);

--------------------------------------

and for sell would be

SellStop = Bid-10*Point;

Ssl = SellStop+(yourStopLoss*Point);

Stp = SellStop + Stp * Point;

OrderSend(Symbol(),OP_SELLSTOP,Lots,3,Ssl,Stp,"",0,0,CLR_NONE);

-----------------------------------------------------

This is one way i could come up with.

regards

EACAN,

I almost forgot ..

so to be complete you would write both OrderSendCommands together

return(0) in the end and that should do it.

EACAN

 

Hi EACAN

thankyou very much for your reply.

I was thinking of doing it in 2 ways.

When ever there is a cross we can see 2 things happening......

1. the price moves in the direction of the cross we can capture some nice profits but

2. when the price moves up and down our stops gets hit and we incur losses.

@ cross if we can set up 2 stop orders at a certain distance apart so that after the whisaws when the price establises a trend at that time one of the stop orders should get hit and the other one cancelled.

the second idea is that at the cross we open a market order in the direction of the cross with a large stoploss lets say 50pips away. Then open a stop order in the opposite direction with the takeprofit 10pips more than the stoploss of the first order. If the trade moves in the wrong direction we will not incur 50 pips loss but hopefully 10 pip profit.

if anyone can code this for testing!!!!

thank you

Reason: