- EDIT your post and place your code in a SRC block. Use the "SRC" icon in the toolbar.
- Explain what is wrong! Don't just say what you want. Explain what is happening, what errors you are getting, etc.
if (OrderClosePrice() - Close[0] >= 400)
If the open price was at 1.12093, it would have to reach 401.12093, not likely to happen
- EDIT your post and place your code in a SRC block. Use the "SRC" icon in the toolbar.
- Explain what is wrong! Don't just say what you want. Explain what is happening, what errors you are getting, etc.
If the open price was at 1.12093, it would have to reach 401.12093, not likely to happen
because i think the 400pips is the distance between order price and current preice .
is it my concept wrong???
There is Tick, PIP, and Point. They are all different in general. A tick is the smallest change of price. A Point is the least significant digit quoted. In currencies a pip is defined as 0.0001 (or for JPY 0.01)
On a 4 digit broker a point (0.0001) = pip (0.0001). [JPY 0.01 == 0.01] On a 5 digit broker a point (0.00001) = 1/10 pip (0.00010/10). Just because you quote an extra digit doesn't change the value of a pip. (0.0001 == 0.00010) EA's must adjust pips to points (for mq4.) In currencies a tick is a point. Price can change by least significant digit (1.23456 -> 1.23457)
In metals a Tick is still the smallest change but is larger than a point. If price can change from 123.25 to 123.50, you have a TickSize of 0.25 and a point of 0.01. Pip has no meaning.
This is why you don't use TickValue by itself. Only as a ratio with TickSize. See DeltaValuePerLot()
You didn't specify 400 pips your specified 400.
if (OrderSelect(0, SELECT_BY_POS)) { double new_tickprofit; if (MathAbs(OrderClosePrice() - Close[0]) >= 400 * Point) { if (OrderType() == OP_BUY) new_tickprofit = NormalizeDouble(OrderClosePrice() + 200 * Point, 4); else if (OrderType() == OP_SELL) new_tickprofit = NormalizeDouble(OrderClosePrice() - 200 * Point, 4); bool ret = OrderModify(OrderTicket(), OrderClosePrice(), OrderStopLoss(), new_tickprofit, 0, Blue);so do you mean i need to change the Point to Pip??
if (MathAbs(OrderClosePrice() - Close[0]) >= 400 * Point)
- Now you have 400 points. You said you want 400 pips.
- OCP is either Bid or Ask. Close[0] is Bid. So that will be true only for Sell orders on a pair with a spread more than 400 points. e.g. USDZAR (776) USDMXN (340) EURHUF (295) Not EURUSD (2-5)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
my original idea is that for example i order a buy eur/usd at 1.12093 , tp was 1.12193 (100pips). then the tp will move at 1.11893(-200pips) afther the market price is 1.11693(-400pips)
pls help me to fix it out
-------------------------------------------------------------------------------------------------------------------------------------