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
Hello Everyone,
I have recently started using MQL5 and I am testing my first algorithm. It is supposed to send a buy limit order to buy a stock at price p_latest and sell it at price (p_latest - stop_loss) or (p_latest + take_profit). My stoploss is 5 points and my takeprofit is 1 points.
However, sometimes it takes profit with 0 or negative profit and stop due to loss with -4 points or -6 points, compared to the initial price, as illustrated in the figure below.
The code is shown below:
I know spread can be a issue, but I just want to ignore its existence and work only with the bid price, so my profits will always be 1 points and losses 5 points, is that possible?
Thanks in advance! :)