ST / TP problem

 

im try learn :)

Im add

extern int Distance = 100;

and now work fine distance

but take profit / stop loss not work

Files:
scalpinglea.mq4  20 kb
 
apnihost:

im try learn :)

Im add

extern int Distance = 100;

and now work fine distance

but take profit / stop loss not work



Do you understand the code of the EA you are changing ??

Why is it needed to have two different magicnumbers one EA ??

What is it the EA you wanna have has to do ??

you are not learning well if you change programs when you don't understand its code

for what reason you have

extern    int      Periods = 14;   //???

So how can we help you ???

 
deVries:


Do you understand the code of the EA you are changing ??

Why is it needed to have two different magicnumbers one EA ??

What is it the EA you wanna have has to do ??

you are not learning well if you change programs when you don't understand its code

for what reason you have

So how can we help you ???


i have no idea .. :(

.. i like this ea soo im add

extern int Distance = 100;

and now distance work well but take porift / stop loss not move

 
apnihost:
i have no idea .. :(
.. i like this ea soo im add extern int Distance = 100; but take porift / stop loss not move
  1. You haven't bothered to learn MT4 so there is no common language for us to communicate with. You have only two choices: learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
  2. Adding an int does NOTHING. You have to add code to move your SL.
 
extern    int ProfitTarget =  20; 
extern    int     StopLoss =  18; 

             if( OrderSelect( tic, SELECT_BY_TICKET ) )
              if (      OrderType()<2 ) continue;
             { OrderModify( tic, SymBid-Distance*point, StopShrt(SymAsk-Distance*point,StopLoss, SymPoints,SymDigits), TakeShrt(SymBid,ProfitTarget,SymPoints,SymDigits), 0, CLR_NONE ); } 

                                       if (      OrderType()<2 ) continue;
                                       
                                        { OrderModify( tic, SymBid+Distance*point, StopLong(SymBid+Distance*point,StopLoss, SymPoints,SymDigits), TakeLong(SymBid,ProfitTarget,SymPoints,SymDigits), 0, CLR_NONE ); } 


 Ticket=OrderSend(FinalSymbol,OP_BUYSTOP,FinalLots,SymBid+Distance*point,0,StopLong(SymAsk+Distance*point,StopLoss, SymPoints,SymDigits),TakeLong(SymBid,ProfitTarget, SymPoints,SymDigits),"some comment",MagicNumberU,0,CLR_NONE);

      Ticket=OrderSend(FinalSymbol,OP_SELLSTOP,FinalLots,SymBid-Distance*point,0,StopShrt(SymAsk+Distance*point,StopLoss, SymPoints,SymDigits),TakeShrt(SymBid,ProfitTarget, SymPoints,SymDigits),"some comment",MagicNumberD,0,CLR_NONE);
take profit / stop loss ... not moveing
 
Had you bothered to test your return values you would have learned that you are not even CALLING OrderModify. What are Function return values ? How do I use them ? - MQL4 forum