Can you tell me how I can manage an EAon the vpc without re-synchronisation ?
I mean: on the terminal I can put buttons on the chart and change the mode without re-synchronisation. Can I use the bot to give commands to the EA on the PPC ?
Or should I use another alternative to change EA mode on mql vps without re-sync ?
When testing any pair, everything works properly, but when working with other currencies, the pending orders are not placed (I have to expose the pending order) and are not closed after take profit triggering.
Please advise how to change the code, if possible:
bool operation=0;for(int pos=0;pos<OrdersTotal();pos++)
{if ( OrderSelect (pos, SELECT_BY_POS) == false ) continue;
if ( OrderSymbol()==Symbol()) break;}
//=========================================================================================================if(Hour()>=2&&Hour()<=18&&operation==0){
if(OPB1==1)
{operation=1;if(operation==0 &&OrderSymbol()!=Symbol()||OrdersTotal()==0)
{OrderSend(Symbol(),OP_BUY,lots,Ask,0,Bid-ss*Point,Ask+T*Point,"My order#",mn,0,Green);}}
if (OrderType()==OP_BUY &&OrdersTotal()==1&&OrderMagicNumber()==8)
{OrderSend(Symbol(),OP_SELLSTOP,5*lots,OrderOpenPrice()-(ss-ss/4)*Point,0,0,SstopClose,"My order#",80,0,Red);}
if(OPS1==1)
{operation=1;if(operation==0 &&OrderSymbol()!=Symbol()||OrdersTotal()==0)
{OrderSend(Symbol(),OP_SELL,lots,Bid,0,Ask+ss*Point,Bid-T*Point,"My order#",mn,0,Red);}}
if (OrderType()==OP_SELL &&OrdersTotal()==1&&OrderMagicNumber()==8)
{OrderSend(Symbol(),OP_BUYSTOP,5*lots,OrderOpenPrice()+(ss-ss/4)*Point,0,0,BstopClose,"My order#",80,0,Green);}}
if(OrderMagicNumber()==80){operation=0;
{for( int ii=OrdersTotal()-1;ii>=0;ii--)
{OrderSelect(ii, SELECT_BY_POS);
int type = OrderType();bool result = false;
switch(type)
{case OP_BUYSTOP : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );//break;case OP_SELLSTOP : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red ); //break;
result = OrderDelete( OrderTicket() );//break;
}}}}
remove the conditions "if (OrdersTotal()==0)....". - they are just saying: search for entries and open new orders only when there are no orders at all.
If you want to avoid opening a big pack of new orders without such a condition, you should provide them with additional conditions. This depends on your strategy: not to open a new one within time T from the previous one, or to control bars or to keep distances in pips between orders.
Тестер стратегий позволяет тестировать и оптимизировать торговые стратегии (советники) перед началом использования их в реальной торговле. При тестировании советника происходит его однократная прогонка с начальными параметрами на исторических данных. При оптимизации торговая стратегия прогоняется несколько раз с различным набором параметров...
Если значение pos меньше длины строки и значение символьного кода = 0, то строка усекается (но размер буфера, распределенного под строку остается неизменным). Длина строки становится равной значению pos.
Good afternoon,
Can you tell me how I can manage an EAon the vpc without re-synchronisation ?
I mean: on the terminal I can put buttons on the chart and change the mode without re-synchronisation. Can I use the bot to give commands to the EA on the PPC ?
Or should I use another alternative to change EA mode on mql vps without re-sync ?
Thanks for the reply !
Hello, dear experts!
Please help me to solve this problem.
When testing any pair, everything works properly, but when working with other currencies, the pending orders are not placed (I have to expose the pending order) and are not closed after take profit triggering.
Please advise how to change the code, if possible:
Good afternoon Dear forum users.
Please help me to improve the indicator that builds the zones on the chart.
In the current indicator the zones are set for all days of the week.
I need to be able to set zones for each day of the week separately.
remove the conditions "if (OrdersTotal()==0)....". - they are just saying: search for entries and open new orders only when there are no orders at all.
If you want to avoid opening a big pack of new orders without such a condition, you should provide them with additional conditions. This depends on your strategy: not to open a new one within time T from the previous one, or to control bars or to keep distances in pips between orders.
Got it, thanks)
Guys, especially the developers, can you tell me if it's possible to solve this problem? The task in the picture
Good afternoon, the warning"possible loss of data due to type conversion" appears on variable n in the highlighted location
Can you please tell me how to correct it?
Good afternoon, the warning"possible loss of data due to type conversion" appears on variable n in the highlighted location
Can you please advise how to correct it?
Either ushort n=0;
Or StringSetChar(s, i, (ushort)n);
But it's better to use StringSetCharacter().
How is it done for themes.
Afternoon.
In a multicurrency Expert Advisor, I need to close a pending order placed against a profit when an open position triggers.
Right now, when I close a pending order at profit, all the pending orders for all currencies are closed.
How do I change the code so that only the pending order related to a currency pair will close and the rest of the pending orders will remain open?
What should I change in this code?
Mn in this code is a magic number of a pending order BUY_STOP or SELL_STOP.
The logic is that when an open position is closed at Take Profit, this magic number is left and the command to delete it is supposed to be executed.
This works when testing each pair. However, when working with other currencies, all orders placed on all pairs are deleted.
Please help, if you can.
I understand that no one has to bother with this problem, but maybe someone has a ready template?
I would be very grateful.