when looking in the journal the orders are not even trying to be modified. i assume there is a problem with the if statements
SladeMcBride:
when looking in the journal the orders are not even trying to be modified. i assume there is a problem with the if statements
when looking in the journal the orders are not even trying to be modified. i assume there is a problem with the if statements
(1) These two lines are different:
if(OrderStopLoss()<Bid-pips*Trailing_Stop)
if(OrderStopLoss()>Ask+pips*Trailing_Stop||OrderStopLoss()==0)
(2) This is not right - usually we check ticksize == 0.01 and == 0.0001, never 0.001 with 0.0001. And if it's 0.0001 or 0.01, then pips should be ticksize / 10, not * 10. (or course, your use of the name 'pips' here is confusing, but that's a different issue... LOL).
if (ticksize == 0.0001 || ticksize == 0.001) pips = ticksize*10; else pips = ticksize;
(3) You want to iterate from OrdersTotal()-1 to 0, not OrdersTotal() to 0 - not necessary.
for(int b=OrdersTotal();b=0;b--)
for(int b=OrdersTotal();b=0;b--)Your loops do nothing, because in the test you assign zero to b, and zero is false, so loop exits immediately.
for(int b=OrdersTotal() - 1; b >= 0; b--)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register