script successfully downloaded and removed

 

I'm struggling with something, very basic actually.
At the moment im following an online course and with the function OrderSend, nothing happens for me.
I do the exact same formula as the online course, where it works, but for me no order sends, just in the expert tab i get the notification " loaded successfully" and then removed.. Do you know what could be the problem? or where I could go to with this question? dont find any explanation online.. (working with a script btw)
OrderSend(NULL,OP_BUYLIMIT,1,1.08200,5,1.07830,1.08920);

Thanks in advance and have a very nice day!
 
Michielvstk:

I'm struggling with something, very basic actually.
At the moment im following an online course and with the function OrderSend, nothing happens for me.
I do the exact same formula as the online course, where it works, but for me no order sends, just in the expert tab i get the notification " loaded successfully" and then removed.. Do you know what could be the problem? or where I could go to with this question? dont find any explanation online.. (working with a script btw)
OrderSend(NULL,OP_BUYLIMIT,1,1.08200,5,1.07830,1.08920);

Thanks in advance and have a very nice day!

Always use 

#property strict

in your code. You would get a warning when you compile that the return of OrderSend() should be checked.

When the order fails, print all the trade details including the current Bid and Ask price along with the error code, GetLastError(), then you can analyse why it failed.

I will move this topic to the MQL4 and MT4 section. In future please post in the correct section. 

 
Don't use NULL.
  1. You can use NULL in place of _Symbol only in those calls that the documentation specially says you can. iHigh does, iCustom does, MarketInfo does not. OrderSend does not.
  2. Don't use NULL (except for pointers where you explicitly check for it.) Use _Symbol and _Period, that is minimalist as possible and more efficient.
  3. Zero is the same as PERIOD_CURRENT which means _Period. Don't hard code numbers.
  4. MT4: No need for a function call with iHigh(NULL,0,s) just use the predefined arrays, i.e. High[].
 
Michielvstk:

I'm struggling with something, very basic actually.
At the moment im following an online course and with the function OrderSend, nothing happens for me.
I do the exact same formula as the online course, where it works, but for me no order sends, just in the expert tab i get the notification " loaded successfully" and then removed.. Do you know what could be the problem? or where I could go to with this question? dont find any explanation online.. (working with a script btw)
OrderSend(NULL,OP_BUYLIMIT,1,1.08200,5,1.07830,1.08920);

Thanks in advance and have a very nice day!

Do not double post!

I have deleted your duplicate topic.