Open position with custom indicator?

 

Hi there,

I wonder if it is possible to open position with custom indicator in MT5. I've created a trading "form" similar to "one click trading", but a bit advanced. Now when I try to open position with click on my button I get error 4752 "auto trading disabled by client". I have auto trading enabled in my terminal. Thanks for your help.

 
arcull:

Hi there,

I wonder if it is possible to open position with custom indicator in MT5. I've created a trading "form" similar to "one click trading", but a bit advanced. Now when I try to open position with click on my button I get error 4752 "auto trading disabled by client". I have auto trading enabled in my terminal. Thanks for your help.

Hi

Indicators can't open trades, only EAs can. If you do have an EA and not an indicator, ensure auto trading is allowed in both the MT options and the EA options 

 
There is oneclicktrading EA on a broker other than default MT4 . It is an EA not indicator. So you need to change it to an EA or code your "advanced form" as an EA.
 
Thanks both. Actually I already have coded an EA, which I use for automatic trading, but this EA doesn't put any objects to the chart, it just trades according to my trade strategy. So if I understand correctly, I could reprogram my existing EA, which would create the "advanced trade form" on the chart using objects. Would that work? The second option is that my existing "advance form" on indicator creates files on disk, which would afterwards be read by my EA, and place trades according to the contents of the files. But this option doesn't look handy. How would you do it?
 
arcull:
Thanks both. Actually I already have coded an EA, which I use for automatic trading, but this EA doesn't put any objects to the chart, it just trades according to my trade strategy. So if I understand correctly, I could reprogram my existing EA, which would create the "advanced trade form" on the chart using objects. Would that work? The second option is that my existing "advance form" on indicator creates files on disk, which would afterwards be read by my EA, and place trades according to the contents of the files. But this option doesn't look handy. How would you do it?

I did it like this, changing a bit my existing EA: I've put code to generate the necessary objects for my advanced trade form on the OnInit event. Then I've added the OnChart event to the EA, like the one one indicators. And it works ok.

void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
{
   if(id==CHARTEVENT_OBJECT_CLICK) {
      if (sparam == "BuyButton") {  
        // logic to place position...
      }
   } 
}
 
arcull:
........ The second option is that my existing "advance form" on indicator creates files on disk, which would afterwards be read by my EA, and place trades according to the contents of the files. But this option doesn't look handy. How would you do it?
use iCustom, maybe?
 
belido:
use iCustom, maybe?
Thanks I haven't thought of that option. But for now I'll stick to my current solution, as far as it works :)
 
try rojak keling. EA