EA not setting t/p s/l appropriately

 

I am not entirely sure what I've done incorrectly here... but it profits for some time but the moment there is a losing trade it just runs until margin call.

Files:
testinge30m.mq4  11 kb
 
Skog23 wrote >>

I am not entirely sure what I've done incorrectly here... but it profits for some time but the moment there is a losing trade it just runs until margin call.

i was not trying, but if you change in your Code ...

StopLossLevel = (Ask - StopLoss) * Point to

StopLossLevel = Ask - (StopLoss * Point)

same for sell order

 
EADeveloper:

i was not trying, but if you change in your Code ...

StopLossLevel = (Ask - StopLoss) * Point to

StopLossLevel = Ask - (StopLoss * Point)

same for sell order

It works for the most part, but now for some reason (seemingly random) I get a 130

 
search forum for "130" you will see many posts they been sent in last 10 days. there is solution
Reason: