Do you realise that Close[0] = Bid ? it changes as Bar 0 is forming . . . bar 0 never has a fixed Close price, when it is actually closed it becomes Bar 1 . . .
Perhaps you should post the latest version of your code.
Yes I now, but the problem is, that my EA opens only one trade per Bar. I want to make new buy order when Close[0]>Open[0] and Close it when Close[0]<Open[0] and vise versa for sell.
here is the code.please tell me why it does not make new orders by Bid movement relating to Open[0] !?
You need to make use of the variable you have created for the return value from OrderSend . . res, check it to see if the OrderSend worked, if it didn't print the error and you will be in a better position to fix your own issues.
Your Orders do not take into account spread . . Buy at Ask, but a Buy is closed with a Sell and a Sell is executed at Bid.
and on the first tick of the bar Close[0] == Open[0]
so your 2 criteria are mutually incompatible.
yes you are right, then i do not used Close[0] >= Open[0] or Close[0] <= Open[0]...
exactly when the current close 1 tick more or less than current Open is, we make new reversal trade and close the other one, but i do not know how to do this.
Unfortunatly i am not a coder, i used other Ea codes and assembeld it. I know about mql codes. I want to know what should i change in the above code in order to permiting several trade in 1 bar?
hmrt135:
Unfortunatly i am not a coder, i used other Ea codes and assembeld it. I know about mql codes. I want to know what should i change in the above code in order to permiting several trade in 1 bar?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Do you realise that Close[0] = Bid ? it changes as Bar 0 is forming . . . bar 0 never has a fixed Close price, when it is actually closed it becomes Bar 1 . . .
Perhaps you should post the latest version of your code.
Yes I now, but the problem is, that my EA opens only one trade per Bar. I want to make new buy order when Close[0]>Open[0] and Close it when Close[0]<Open[0] and vise versa for sell.
here is the code.please tell me why it does not make new orders by Bid movement relating to Open[0] !?
You need to make use of the variable you have created for the return value from OrderSend . . res, check it to see if the OrderSend worked, if it didn't print the error and you will be in a better position to fix your own issues.
Your Orders do not take into account spread . . Buy at Ask, but a Buy is closed with a Sell and a Sell is executed at Bid.
Yes I now, but the problem is, that my EA opens only one trade per Bar.
After the first trade is placed bartime = Time[0]; so you cannot place more than 1 trade per bar . . your code does not allow it.
and on the first tick of the bar Close[0] == Open[0]
so your 2 criteria are mutually incompatible.
and on the first tick of the bar Close[0] == Open[0]
so your 2 criteria are mutually incompatible.
yes you are right, then i do not used Close[0] >= Open[0] or Close[0] <= Open[0]...
exactly when the current close 1 tick more or less than current Open is, we make new reversal trade and close the other one, but i do not know how to do this.
After the first trade is placed bartime = Time[0]; so you cannot place more than 1 trade per bar . . your code does not allow it.
yes you are right, but how can i repair it?
i do not know how to make reversal code for several position on 1 bar?
i do not know how to make reversal code for several position on 1 bar?
Unfortunatly i am not a coder, i used other Ea codes and assembeld it. I know about mql codes. I want to know what should i change in the above code in order to permiting several trade in 1 bar?