Download MetaTrader 5

Scripts not working after build 625

To add comments, please log in or register
Do you have questions on how to turn your idea into reality? Ask them on the Forum!
vali
34
vali 2014.03.27 13:27 

Hi, everyone and MetaQuotes!

Please, who can help me with this: after the update with build 625, i cant use any script, because, i think, my scripts not working correct. The fact is this: when i launch a script nothing happened on the screen or with my orders, but, when i tried to re-open the same script or to open another one, i`m asked if i want to close / or not the firs script already opened. I recompiled the script / scripts - nothing new happened. there are not error in `expert / journal`. I erased the scripts and download its again - the same action. I download more then 10 another scripts from codebase.mql4.com - the same. I download another MetaTrade 4 from another broker with import of the scripts - nothing change. I always restart the platform or even pc after every download.

Thanking you in anticipation!

qjol
3243
qjol 2014.03.27 13:47  
show some code and someone will try to help you
Alain Verleyen
Moderator
30752
Alain Verleyen 2014.03.27 14:00  
unash:

Hi, everyone and MetaQuotes!

Please, who can help me with this: after the update with build 625, i cant use any script, because, i think, my scripts not working correct. The fact is this: when i launch a script nothing happened on the screen or with my orders, but, when i tried to re-open the same script or to open another one, i`m asked if i want to close / or not the firs script already opened. I recompiled the script / scripts - nothing new happened. there are not error in `expert / journal`. I erased the scripts and download its again - the same action. I download more then 10 another scripts from codebase.mql4.com - the same. I download another MetaTrade 4 from another broker with import of the scripts - nothing change. I always restart the platform or even pc after every download.

Thanking you in anticipation!

Please don't double post. I removed your other post.
vali
34
vali 2014.04.08 08:15  
qjol:
show some code and someone will try to help you


The scripts i used are:

- `DROP_PENDING_SELL.mq4` from https://www.mql5.com/en/code/9667;

- `DROP_PENDING_BUY.mq4` from https://www.mql5.com/en/code/9666;

- `Modify_BUY-SL-TP.mq4` and `Modify_SELL-SL-TP.mq4` from https://www.mql5.com/en/code/10835;

- `PZ_DeleteAllPendingOrders.mq4` from https://www.mql5.com/en/code/10832.

Thank you!

Ahmad Mehdiyev
478
Ahmad Mehdiyev 2014.04.08 09:50  

Remove all the underscore signs "_" in the names of the inputs. It is possible that scripts are not working simply because that sign is no longer allowed in the variable names. I colored them red for you to see. Do that in every script you have.

#property show_inputs
//#property show_confirm
 
extern double Lots    = 0.1;
extern int Slippage   = 3;
extern int Stop_Loss  = 20;
extern int Take_Profit = 20;
 
//+------------------------------------------------------------------+
//| script "Open a new Buy Order"                                    |
//+------------------------------------------------------------------+
int start()
  {
   double Price = WindowPriceOnDropped();
   bool   result;
   int    cmd,total,error,slippage;
   
//----
   int NrOfDigits = MarketInfo(Symbol(),MODE_DIGITS);   // Nr. of decimals used by Symbol
   int PipAdjust;                                       // Pips multiplier for value adjustment
      if(NrOfDigits == 5 || NrOfDigits == 3)            // If decimals = 5 or 3
         PipAdjust = 10;                                // Multiply pips by 10
         else
      if(NrOfDigits == 4 || NrOfDigits == 2)            // If digits = 4 or 3 (normal)
         PipAdjust = 1;            
//----   
   
   slippage = Slippage * PipAdjust; 
   
   double stop_loss = Price + Stop_Loss * Point * PipAdjust;
   double take_profit = Price - Take_Profit * Point * PipAdjust; 
   
   if(Bid > Price)
   {
   result = OrderSend(Symbol(),OP_SELLSTOP,Lots,Price,slippage,stop_loss,take_profit,"",0,0,CLR_NONE);
   }
   if(Bid < Price)
   {
   result = OrderSend(Symbol(),OP_SELLLIMIT,Lots,Price,slippage,stop_loss,take_profit,"",0,0,CLR_NONE);
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+


vali
34
vali 2014.04.08 10:44  

Thank you, pro!

Unfortunately, still not working!

Keith Watford
Moderator
9644
Keith Watford 2014.04.08 11:23  
pro_:

Remove all the underscore signs "_" in the names of the inputs. It is possible that scripts are not working simply because that sign is no longer allowed in the variable names. I colored them red for you to see. Do that in every script you have.



I'm still using the underscore with no problems. In fact if you look at the example codes in the documentation, they are littered with variables including underscores

Ahmad Mehdiyev
478
Ahmad Mehdiyev 2014.04.08 12:14  
I guess "what they say" and "what they do" do not match then. Sorry.
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.04.08 12:14  
The problem most probably because of mt4 data structure.
qjol
3243
qjol 2014.04.08 12:22  
what error do you get ?
vali
34
vali 2014.04.09 07:04  
pro_:
I guess "what they say" and "what they do" do not match then. Sorry.


I`m using those scripts for at least one year, without any problems. Thanks anyway.
123
To add comments, please log in or register