Dear people at babypips, got a question related to automatic trading. I’m currently writing a C# propietary system, just for fun as I’m not a professional trader, learning the basics and running back tests with my strategies. This project became quite extensive as invested the past 6 month on it.
Got a question about decision making and which price to consider. Some of the implemented ideas on my platform are based on MetaTrader 5 and for what experts say, this system builds candlestick and runs indicators based on “Bid Price”. Do you guys know if this is correct?
Also, bid price is fine when selling but what buying? This could mean loses specially with high levels of leverage; so in general when closing a long position the pips difference between Bid and Ask should be greater than the pips gained by the position that is being closed, as general rule?
Not sure if what I’m asking makes sense but this is my first shot in the forum. Thanks in advance!
Ideally, you should be using bid prices when looking at entering shorts/exiting longs and offer prices when entering longs/exiting shorts. If you need to pick only one, then try to come up with a good estimate of the spread to you can account for it in the P/L results.
Thanks for your tip. But what if you are in a neutral position waiting for an indicator to fire, would you run two parallel analysis? or the spread is not significant enough to justify the effort?
Well, if you’re trading something with a tight spread like EUR/USD and not looking at a scalping type of strategy where the spread can be a major influence, then you can probably not worry much about it in terms of signal generation. Just make sure it’s accounted for in you P&L calculations, especially if the average gain/loss is fairly small.
That said, the proper mechanics for full precision would require accepting signals only when the bid or ask reaches the required trigger level. How that would be implemented depends on the type of approach you’re taking.
For example, if you’re using a moving average crossover system then the MA will have to be calculated using some consistent quote type - bid, ask, or mid. In reality, that MA level represents a band spanning the area from the bid to the ask. As such, you’d probably only want to go long when the ask level (at which you’d enter longs) moves above the ask element of that band. You could do that by having an MA of the ask price, and an MA of the bid for shorts, as you’ve suggested. More simply, though, you could just recognize derive a value for the ask MA and/or bid MA from the actually MA value and set up you trade entry conditionality on that, like:
Go long when Current Ask > MA(mid)+(.5 x B/A Spread)
Meaning go long when the current ask is greater than the MA of the mid rate plus half the spread. If you’re using the bid for the MA calculation then you’d add the full spread.
Hope that makes sense.
It does make a lot of sense. Thanks a lot for this useful information.