[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 1095
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
I did not write right away an EA without indicators, there are no indicators, just orders to buy and sell and so on--- and then the periods that have changed in the tester and the end result is still nothing I do not understand
You cannot say anything without the Expert Advisor itself. I am just guessing.
What should I do with Ilan6 to make him start trading? How much money does it start to work and does it work on a cent at all?
I did not write right away an EA without indicators, there are no indicators, just orders to buy and sell and so on--- and then the periods that have changed in the tester and the end result is still nothing I do not understand
Yes, we should look at the code itself. Doesn't it have some kind of strategy, on the basis of which calculations it opens and closes orders?
Can you tell me where the mistake is? If there is a market order to sell our financial instrument, then close it and if there is no order to buy, then open one order to buy. Everything is normal here with closing, but it opens them not once, but with every tick.
//--------------------------------------------------------------------------------------------
extern double LOT = 0.01;
//--------------------------------------------------------------------------------------------
int start()
{
int sells=0;
for (int i=0; i<OrdersTotal(); i++)
{
if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
{
if (OrderSymbol() !=Symbol() || OrderType() !=OP_SELL ) continue;
OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,White);
Alert (GetLastError()); // Выводит сообщение об ошибке
sells++;
}
}
if (sells==0)
{
OrderSend(Symbol(),OP_BUY,LOT,Ask,1,Bid-400*Point,Bid+400*Point,0,Green);
Alert (GetLastError()); // Выводит сообщение об ошибке
return(0);
}
}
//--------------------------------------------------------------------------------------------
Can you tell me where the mistake is? If there is a market order to sell our financial instrument, then close it and if there is no order to buy, then open one order to buy. Everything is normal here with closing, but it opens them not once but with every tick.
//--------------------------------------------------------------------------------------------
extern double LOT = 0.01;
//--------------------------------------------------------------------------------------------
int start()
{
int sells=0;
for (int i=0; i<OrdersTotal(); i++)
{
if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
{
if (OrderSymbol() !=Symbol() || OrderType() !=OP_SELL ) continue;
OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,White);
Alert (GetLastError()); // Выводит сообщение об ошибке
sells++;
}
}
if (sells==0)
{
OrderSend(Symbol(),OP_BUY,LOT,Ask,1,Bid-400*Point,Bid+400*Point,0,Green);
Alert (GetLastError()); // Выводит сообщение об ошибке
return(0);
}
}
//--------------------------------------------------------------------------------------------
Or is it better to do so? If there are no sell orders, we will not open a buy order.
extern double LOT = 0.01;
//--------------------------------------------------------------------------------------------
int start()
{
for (int i=0; i<OrdersTotal(); i++)
{
if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
{
if (OrderSymbol() !=Symbol() || OrderType() !=OP_SELL ) continue;
OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,White);
Alert (GetLastError()); // Выводит сообщение об ошибке
OrderSend(Symbol(),OP_BUY,LOT,Ask,1,Bid-400*Point,Bid+400*Point,0,Green);
Alert (GetLastError()); // Выводит сообщение об ошибке
return(0);
}
}
}
//--------------------------------------------------------------------------------------------
Rule for the execution of the for statement
Tell me: a tick has come, Condition of for operator is true, control is passed further - all this will happen during one tick, i.e. all these operators will be executed during 1 tick or not.
extern double LOT = 0.01;
//--------------------------------------------------------------------------------------------
int start()
{
for (int i=0; i<OrdersTotal(); i++)
{
if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
{
if (OrderSymbol() !=Symbol() || OrderType() !=OP_SELL ) continue;
OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,White);
Alert (GetLastError()); // Выводит сообщение об ошибке
OrderSend(Symbol(),OP_BUY,LOT,Ask,1,Bid-400*Point,Bid+400*Point,0,Green);
Alert (GetLastError()); // Выводит сообщение об ошибке
return(0);
}
}
}
//--------------------------------------------------------------------------------------------
Or exactly which operators will be executed during this tick? All of the above or which ones will be executed during the next tick? Explain...
Rule for the execution of the for statement
Tell me: a tick has come, Condition of for operator is true, control is passed further - all this will happen during one tick, i.e. all these operators will be executed during 1 tick or not.
Or exactly which operators will be executed during this tick? All of the above or which ones will be executed during the next tick? Explain...
The start() function is executed when the first tick arrives. If other ticks arrive while the function is running, they will be skipped.
The start function will be executed completely according to its logic
Rule of for statement execution
Tell me: a tick has come, Condition of for operator is true, control is passed further - all this will happen during one tick, i.e. all these operators will be executed during 1 tick or not.
extern double LOT = 0.01;
//--------------------------------------------------------------------------------------------
int start()
{
for (int i=0; i<OrdersTotal(); i++)
{
if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
{
if (OrderSymbol() !=Symbol() || OrderType() !=OP_SELL ) continue;
OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,White);
Alert (GetLastError()); // Выводит сообщение об ошибке
OrderSend(Symbol(),OP_BUY,LOT,Ask,1,Bid-400*Point,Bid+400*Point,0,Green);
Alert (GetLastError()); // Выводит сообщение об ошибке
return(0);
}
}
}
//--------------------------------------------------------------------------------------------
Or exactly which operators will be executed during this tick? All of the above or which ones will be executed during the next tick? Explain...
Got it figured out. All operators will be executed if the condition is depleted.