create new expert advisor

 

First, let me thank you for your help.
It's been a few days already that i'm trying to find a solution to my problem.
I wanna make an expert advisor a bit special.
I wanna put 2  first command (buy and sell) at the same time
for example: Buy=15$  and Sell=-15$

we take the 15$ and leave the  -15$ open

now I would like to open my commands stopbuy and stopsell.

There's my expert advisor that I've tried to make, both doesn't work.

Do you have a solution for me?

Thank you

 

Please excuse my English, I've tried my best.

 

 

This works well

 

switch(totallots)

{

case 0.0 :

    OrderSend(Symbol(),OP_BUYSTOP,FirstLot,Ask+(Step*0.3)*Point,3,0,0,"",Magic,0,Green);

    OrderSend(Symbol(),OP_SELLSTOP,FirstLot,Bid-(Step*0.3)*Point,3,0,0,"",Magic,0,Red);

    break ;

case 0.1 :

    OrderSend(Symbol(),OP_BUYSTOP,FirstLot,Ask+(Step*5)*Point,3,0,0,"",Magic,0,Green);

    OrderSend(Symbol(),OP_SELLSTOP,FirstLot,Bid-(Step*5)*Point,3,0,0,"",Magic,0,Red); 

    OrderSend(Symbol(),OP_BUYSTOP,FirstLot,Ask+(Step*1)*Point,3,0,0,"",Magic,0,Green);

    OrderSend(Symbol(),OP_SELLSTOP,FirstLot,Bid-(Step*1)*Point,3,0,0,"",Magic,0,Red);

    break ;

default : return(0);

}

 

This does not work

switch(totallots)

{

case 0.0 :

    OrderSend(Symbol(), OP_BUY, 1, Ask, 3, 0 , Ask + 15 * Point, "Un commentaire", Magic, 0, Green);

    OrderSend(Symbol(), OP_SELL, 1, Bid, 3, 0 , Bid - 15 * Point, "Un commentaire", Magic, 0, Green);

    break ;

 

Thank you for your help

 
tintinous:

First, let me thank you for your help.
It's been a few days already that i'm trying to find a solution to my problem.
I wanna make an expert advisor a bit special.
I wanna put 2  first command (buy and sell) at the same time
for example: Buy=15$  and Sell=-15$

we take the 15$ and leave the  -15$ open

now I would like to open my commands stopbuy and stopsell.

There's my expert advisor that I've tried to make, both doesn't work.

Do you have a solution for me?

Thank you

<CODE DELETED>

Please read some other posts before posting . . .

Please   edit   your post . . .    please use the   SRC   button to post code: How to use the   SRC   button. 

 
tintinous:

First, let me thank you for your help.
It's been a few days already that i'm trying to find a solution to my problem.
I wanna make an expert advisor a bit special.
I wanna put 2  first command (buy and sell) at the same time
for example: Buy=15$  and Sell=-15$

we take the 15$ and leave the  -15$ open

now I would like to open my commands stopbuy and stopsell.

There's my expert advisor that I've tried to make, both doesn't work.

What does  " doesn't work."  mean ?  you need to be specific about your issue . . .  doesn't it compile ?  what does it do that it shouldn't ?  what doesn't it do that it should ?  

Please note:   Please   edit   your post . . .    please use the   SRC   button to post code: How to use the   SRC   button. 

Reason: