[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 1092
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
No requotes.
No requotes.
It only on the fast server
kolyango:
Actually, dear "comrade", I take it you're not going to learn, you could have seen how to use variables correctly on the editor's website and in the Help.
People, Humans, learn how to use the MT4 editor's help, it's all there and in detail.
Here is the text from the help.
Happy New Year 2011!!!!
for( i = 0; i < total; i++) {
OrderSelect( ticket,SELECT_BY_TICKET,MODE_TRADES );
if(OrderSymbol() == Symbol() && OrderMagicNumber() == 16384&OrderType() == OP_SELL)
{ if(Nyzhnyayaghranytsa>Close[i])
{ OrderCloseBy (ticket,ticket,Green);Alert("OrderCloseBySell", GetLastError()); }}
OrderSelect( ticket,SELECT_BY_TICKET,MODE_TRADES );
if(OrderSymbol() == Symbol()&&OrderMagicNumber() == 16384 &&OrderType() == OP_BUY)
{ if (Verhnyayaghranytsa<Close[i])
{ OrderCloseBy (ticket,ticket,Green);Alert("OrderCloseByBuy", GetLastError();}} }
I am here inside the bollinger bounds, trying to reverse the order to reverse.Nothing happens,nothing at all,and not even an error or even a zero in the logs!
Maybe there is a comma somewhere?
I have been looking at this place for half an hour!
Ask me, I'll give you an answer. I'll ask.
What's the best other turkey to accompany the bollinger?
Happy New Year 2011!!!!
for( i = 0; i < total; i++) {
OrderSelect( ticket,SELECT_BY_TICKET,MODE_TRADES );
if(OrderSymbol() == Symbol() && OrderMagicNumber() == 16384&&OrderType() == OP_SELL)
{ if (Nyzhnyayaghranytsa>Close[i])
{ OrderCloseBy (ticket,ticket,Green);Alert("OrderCloseBySell", GetLastError()); }}
OrderSelect( ticket,SELECT_BY_TICKET,MODE_TRADES );
if(OrderSymbol() == Symbol()&&OrderMagicNumber() == 16384 &&OrderType() == OP_BUY)
{ if (Verhnyayaghranytsa<Close[i])
{ OrderCloseBy (ticket,ticket,Green);Alert("OrderCloseByBuy", GetLastError());}} }
I am inside the bollinger bounds here, I try to reverse the order when it touches. Nothing happens, nothing at all, and not even an error or even a zero in the logs!
Maybe a comma is missing somewhere?
I've been looking at this place for half an hour!
Well, first, you are looking for a closed bar "if (Verhnyayaghranytsa<Close[i]" where i you have = 0, and this is a bar that has not yet closed, you should either change it to Open or Close[i+1].
Second, OrderCloseBy(int ticket, int opposite, colour Color=CLR_NONE), where ticket and opposite are different order numbers of different orders.
Third, OrderCloseBy does not flip from one order to another, it flips the deposit, instead of closing it and opening a new one in the opposite direction.
You have to close the old one yourself and open a new one.
Happy 2011!!!!
----------------------------------------------
I've been looking at this place for half an hour!
Why don't you go and get yourself a beer and some fish, or some champagne and a fruit selection, and you'll see if you get some 'enlightenment'...:-)))
Happy New Year!
The question is a classic one. WHAT TO DO?))