I believe that your conditions for opening are taking in consideration that for BuyStop, entry price should be above current price, so that candle 0 should be bearish. But… why is your EA opening pendings? Why not making it open market orders? Any reason for that?
Yes there is a reason for that.
Yes I am aware as to the BuyStop and SellStop orders are.
Still getting the same unwanted result.
Hi there
So I have an EA which places a Pending Order at the opening price of the current candle, and expires at the end of the current candle.
My code is below, I have even printed an error function in order to diagnose any errors that may occur, however, according to the EA, a pending order is placed so no error appears.
Sometimes a pending order is actually successfully executed, and other times, it tells me a pending order has been placed successfully, but no pending order appears on the chart.
There are no error messages.
Clearly there are no errors, so it must be something to do with my coding. What am I missing here? Why does it sometimes placed a pending order on the chart, and others times it decided not to?
In addition to this, I'm getting random entry prices in my trade ledger, despite clearly specifying the price with which I want my EA to execute a position. It seems to correct itself when I reinit the EA, but I really should not need to do this.
Many thanks.
I think your conditions are in accordance with the BUYLIMIT order instead of BUYSTOP. Try replacing it with BUYLIMIT.
Then you will need to add the condition that the current buying price goes lower( + STOPLEVEL accordance in your broker level ) than the opening price of the candle into your conditions.
if( <Conditions are met > ){
I don't know if it already exists because you show the conditions as closed.
Then you will need to add the condition that the current buying price goes lower( + STOPLEVEL accordance in your broker level ) than the opening price of the candle into your conditions.
I don't know if it already exists because you show the conditions as closed.
Will give it a go, but why does it not return the error message like I have asked it to?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi there
So I have an EA which places a Pending Order at the opening price of the current candle, and expires at the end of the current candle.
My code is below, I have even printed an error function in order to diagnose any errors that may occur, however, according to the EA, a pending order is placed so no error appears.
Sometimes a pending order is actually successfully executed, and other times, it tells me a pending order has been placed successfully, but no pending order appears on the chart.
There are no error messages.
Clearly there are no errors, so it must be something to do with my coding. What am I missing here? Why does it sometimes placed a pending order on the chart, and others times it decided not to?
In addition to this, I'm getting random entry prices in my trade ledger, despite clearly specifying the price with which I want my EA to execute a position. It seems to correct itself when I reinit the EA, but I really should not need to do this.
Many thanks.