i’m testing an expert advisor. I buy using the CTrade library using the Buy(1,NULL,0,0,0) method; I set the price to 0, so it should buy at the Ask price. As a
result, the candle has not gone anywhere yet, I buy at the opening, and he bought figs knows at what unprofitable price already. What can This Be? If I set
even the opening price in the method, it still buys at the curve price.
As you can see in the screenshot, the candle has not gone anywhere yet, and he buys very far from its opening.
ya_programmer
in the tester, you can set any spread
at least in 4-pke
but it is extremely undesirable to set less than the existing one
b
If it’s forex, then YES.
If the instrument is exchange-traded (stocks, futures …) Then almost always the chart is based on flippers, which can differ significantly from bids.
Judging by the price in the screenshot of the author, he clearly does not have forex.
vitales
Buy at the Ask price sell at the Bid price. Candlesticks on the chart are displayed at the Bid price. Moreover, if you open a
position with a market order, as a result of slippage, you can get positions at a price much worse than expected. If you
need the execution of the order “penny to penny” then use limit orders.
vogul
Good afternoon.
i haven’t visited the forum for a long time.
Open and close requests may contain a parameter that defines the open and close policy. How this will work when
opening / closing a market position depends on the broker. The nearest price in the glass may be undesirable. Therefore, it is better to ask
set the open/close price and handle the situation when the position does not pass for any reason.
fresto
and, it turns out I can sell at this price ( opening candles), and buy at a completely different one?
vitales
Candles are drawn at the bid price.