EAs wont place trades - page 2

 
yui111 #:

What could be the cause of this error: Trading is prohibited for account 67151430. Perhaps the connection to the trading account was made via an investment.

I install the advisor, and there is this.

You can also check if the EA has any security features on it, Allow algo and check the Experts tab to see if there are any notifications regarding EA security
 
Hi guys, I have EA with 0 error and 0 warning but it wont trade for me? Can someone help me? Thanks.
Files:
 
03271994 #:
Hi guys, I have EA with 0 error and 0 warning but it wont trade for me? Can someone help me? Thanks.

I did a Print() test of your can_buy and can_sell variable values, and they always return true. Based on the common usage of the RSI indicator, you seem to have inverted < and > in your code. I swapped them and only can_buy or can_sell returned true at a given time:

   Print("can_buy ", can_buy);
   Print("can_sell ", can_sell);

   // RSI Reset Logic
   if(!can_buy && rsi[0] < 50.0) {
      GlobalVariableSet(gv_buy_name, 1.0);
      can_buy = true;
   }
   if(!can_sell && rsi[0] > 50.0) {
      GlobalVariableSet(gv_sell_name, 1.0);
      can_sell = true;
   }

Unless your EA is communicating with an external file in MT5, there's no need to use terminal-wide GlobalVariables. For manual tracking purposes, you can simply Print() to the Experts tab.

 
Ryan L Johnson #:

I did a Print() test of your can_buy and can_sell variable values, and they always return true. Based on the common usage of the RSI indicator, you seem to have inverted < and > in your code. I swapped them and only can_buy or can_sell returned true at a given time:

Unless your EA is communicating with an external file in MT5, there's no need to use terminal-wide GlobalVariables. For manual tracking purposes, you can simply Print() to the Experts tab.

Hello Sir, Can you please give me that whole source code that you swapped or corrected? I just ruined my code when I inserted it, i didn't know exactly where will i put it. Thank you Sir!!