Download MetaTrader 5

How to enable autotrading?

To add comments, please log in or register
SteelAce
203
SteelAce  

I included Triple Exponential Moving Average (TEMA) indicator to my code and now all that code is compiled as indicator. When I attach it to chart then there are no question about autotrading. But I need it! How I can get that question (option) back? (Or change indicator to EA?)







Stuart Browne
6603
Stuart Browne  

Hi 

Indicators can't trade, only EA's can. If there is no code to open orders, it doesn't matter what you do, it won't open a trade. If you want to turn an indicator into an EA I suggest opening a job in the freelance section. And remember, if you do have an EA, you have to allow trading in both the MT options and in the EA options.

SteelAce
203
SteelAce  
Filter:

Hi 

Indicators can't trade, only EA's can. If there is no code to open orders, it doesn't matter what you do, it won't open a trade. If you want to turn an indicator into an EA I suggest opening a job in the freelance section. And remember, if you do have an EA, you have to allow trading in both the MT options and in the EA options.

There exists command  "OrderSend" in my code.
Biantoro Kunarto
17784
Biantoro Kunarto  
You can't use ordersend in indicator, you must change your indicator to EA.
SteelAce
203
SteelAce  
biantoro:
You can't use ordersend in indicator, you must change your indicator to EA.
That's it! I want to change indicator to EA but I don't know how to do that. Compiler don't have options, it just compiles as it likes.
Irwan Adnan
928
Irwan Adnan  
SteelAce:
That's it! I want to change indicator to EA but I don't know how to do that. Compiler don't have options, it just compiles as it likes.
I dont know what exactly is your question. But perhaps  you should use OnTick function (for EA) instead of OnCalculate (for Indicator). But you cant just replace that stuff. Usually coder use iCustom to use custom indicator to their EA code.
SteelAce
203
SteelAce  
belido:
I dont know what exactly is your question. But perhaps  you should use OnTick function (for EA) instead of OnCalculate (for Indicator). But you cant just replace that stuff. Usually coder use iCustom to use custom indicator to their EA code.
Right, that indicator uses OnCalculate and that is indeed problem. I don't know how to change that situation yet.
Stuart Browne
6603
Stuart Browne  
Also, once you do manage to re-code it, make sure you save it in the EA folder, not the indicator folder. Otherwise MT will still think it's an indicator
SteelAce
203
SteelAce  
I succeeded to read indicator data with iCustom and CopyBuffer commands. I didn't find information about what index to use in CopyBuffer but with trials I did find that zero is exactly right one what you really see on chart! Then of course trading is allowed again. Thanks everybody!
Irwan Adnan
928
Irwan Adnan  
SteelAce:
I succeeded to read indicator data with iCustom and CopyBuffer commands. I didn't find information about what index to use in CopyBuffer but with trials I did find that zero is exactly right one what you really see on chart! Then of course trading is allowed again. Thanks everybody!
You are welcome. We all are happy to hear that. 
To add comments, please log in or register