- does anyone know how to keep an EA's source code remote. I want to share my EA but don't want them see the code.
- how do i use custom indicator without the source code
- Help with .ex4 file
I have an EA I have coded using a custom indicator and it's working well. Now here comes my problem I want to share the EA to a friend but I don't want to share the indicator ex4 file with them. Is there a way of incorporating the indicator then share the EA file with them. Note I don't want them to have access on my indicator just EA file. Kindly help
Yes
- compile your indicator with the could compiler
- place the indicator .ex5 in the same folder as the EA
- include the line #resource and the indicator name in your EA
- create a handle for the indicator using the prefix "::" and indicator file name
- compile your EA with the cloud compiler too
Here is an example
#property version "1.00" #resource "blabla.ex5"; int handle=0; bool setup=false; datetime barStamp=0; int OnInit() { setup=false; barStamp=0; return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { if(handle!=INVALID_HANDLE){ IndicatorRelease(handle); } } void OnTick() { if(setup){ datetime now=iTime(_Symbol,_Period,0); if(now>barStamp){ barStamp=now; double buff[]; CopyBuffer(handle,0,0,1,buff); Print("Indicator ("+buff[0]+")"); } }else{ handle=iCustom(_Symbol,_Period,"::blabla.ex5",4,2.7); if(handle!=INVALID_HANDLE){ setup=true; } } }
Yes
- compile your indicator with the could compiler
- place the indicator .ex5 in the same folder as the EA
- include the line #resource and the indicator name in your EA
- create a handle for the indicator using the prefix "::" and indicator file name
- compile your EA with the cloud compiler too
Here is an example
Thank you for your assistance. How can I do it in mql4 since it's an ex4 file. I have little knowledge in coding mql5 language
Also I do not wish to share my indicator with anyone just EA ex4 file how can I do it
Same process without the handle creation and you call straight up with iCustom to use it adding the "::" prefix in the name.
The indicator when you resource it , it is in the EA you don't need to send it (like when you order pizza the pepperoni is on the pizza ,they don't have to send a pack of pepperonis with the order) , but , you have to be careful :
- When you edit the indicator you must make sure you edited the one on the proper folder
- When you edit the indicator you must also hit compile on the EA
Same process without the handle creation and you call straight up with iCustom to use it adding the "::" prefix in the name.
The indicator when you resource it , it is in the EA you don't need to send it (like when you order pizza the pepperoni is on the pizza ,they don't have to send a pack of pepperonis with the order) , but , you have to be careful :
- When you edit the indicator you must make sure you edited the one on the proper folder
- When you edit the indicator you must also hit compile on the EA
Thank you I also with to get your assistance on this grid function, currently it opens orders after the specified distance if they are running negative. I want the function to only open grid orders once a signal is triggered at the specified distance. That is if specified distance is 55 pips then at 55 pips the condition for either sell or buy is met the grid will trigger the order
void Grid() { if(use_marti == true) { if(data.buys > 0) { if(Ask <= data.buy_open_price - marti_Distance * Point()) { double lots = data.buy_lots; if(use_marti && multiplier > 0)lots = lots * multiplier; BUY(lots); data = GetData(data); ModifyTP(); } } if(data.sells > 0) { if(Bid >= data.sell_open_price + marti_Distance * Point()) { double lots = data.sell_lots; if(use_marti && multiplier > 0)lots = lots * multiplier; data = GetData(data); SELL(lots); ModifyTP(); } } } }
Thank you I also with to get your assistance on this grid function, currently it opens orders after the specified distance if they are running negative. I want the function to only open grid orders once a signal is triggered at the specified distance. That is if specified distance is 55 pips then at 55 pips the condition for either sell or buy is met the grid will trigger the order
It depends
You can check if the distance has been breached only if you receive a buy or sell signal from the indicator..
Or you can carry the switches after the check until they change , and if the distance is breached and the switch is active , take the trade .
(and don't forget to reset the switches after the trade)
It depends
You can check if the distance has been breached only if you receive a buy or sell signal from the indicator..
Or you can carry the switches after the check until they change , and if the distance is breached and the switch is active , take the trade .
(and don't forget to reset the switches after the trade)
Thank you
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
- 2023.03.12
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use