endy5:
Because condition as OrderClosePrice()==OrderOpenPrice()+OrderTakeProfit() (for long) isn´t reliable code for very quickly market or gap...
Example: My broker have comment "tp" for positon ended on target price ans comment "sl" for positin which finish on stop loss. But does have it all brokers?
Because condition as OrderClosePrice()==OrderOpenPrice()+OrderTakeProfit() (for long) isn´t reliable code for very quickly market or gap...
Example: My broker have comment "tp" for positon ended on target price ans comment "sl" for positin which finish on stop loss. But does have it all brokers?
- Price plus a price is meaningless. OrderTakeProfit() is not an offset.
- Isn't reliable because SL/TP are stops - they become market orders when triggered - price will never be reliably exact.
- Isn't reliable because price is a float - The == operand. - MQL4 forum
- Most broker's don't.
double OCP = OrderClosePrice(); bool isSL = MathAbs( OCP - OrderStopLoss() ) < MathAbs( OCP - OrderTakeProfit() );
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
Hi quys,
I think.... how precisely identify close position on target price, or stop loss price.
Because condition as OrderClosePrice()==OrderOpenPrice()+OrderTakeProfit() (for long) isn´t reliable code for very quickly market or gap...
I don´t know that OrderComment() by closed order is the same all brokers or no.
Example: My broker have comment "tp" for positon ended on target price ans comment "sl" for positin which finish on stop loss. But does have it all brokers?
Or other idea?
Thank you.