Experts: AK-47 Scalper EA - page 2

 
fxsaber #: Convert to MT5:

it can be easily ... AK-47 Scalper EA - expert for MetaTrader 5 

Code Base

AK-47 Scalper EA

Nguyen Quoc Hung, 2023.06.11 18:06

The AK-47 Scalper EA is fully automated. It employs a strategy of continuously entering Sell Stop orders and will modify them when the price moves against the pending orders.
 

I optimized and test run it on xauusd. the results are good. As per testing, it only makes sell positions. I tried to add a 2 ma as condition for buy or sell orders but it only send sell orders.  I inserted the code below...

double fastEMA = iMA(Symbol(), 0, FastEMA_Period, 0, MODE_EMA, PRICE_CLOSE);
double slowEMA = iMA(Symbol(), 0, SlowEMA_Period, 0, MODE_EMA, PRICE_CLOSE);

string strTrend = "";

//if (upFractal > 0) {
if(fastEMA > slowEMA) {
   string strTrend = "UP";
   OrdType = ORDER_TYPE_BUY;
}

//if (downFractal > 0) {
if(fastEMA < slowEMA) {
   string strTrend = "DOWN";
   // Open a sell trade here
   OrdType = ORDER_TYPE_SELL;
}
Improperly formatted code edited by moderator
 
NanoMan #: I optimized and test run it on xauusd. the results are good. As per testing, it only makes sell positions. I tried to add a 2 ma as condition for buy or sell orders but it only send sell orders.  I inserted the code below...
Improperly formatted code edited by moderator

Improperly formatted code edited by moderator. Please always use the CODE button (Alt-S) when inserting code.

Code button in editor

 
NanoMan #:
double fastEMA = iMA(Symbol(), 0, FastEMA_Period, 0, MODE_EMA, PRICE_CLOSE); double slowEMA = iMA(Symbol(), 0, SlowEMA_Period, 0, MODE_EMA, PRICE_CLOSE); string strTrend = ""; //if (upFractal > 0) { if(fastEMA > slowEMA) {    string strTrend = "UP";    OrdType = ORDER_TYPE_BUY; } //if (downFractal > 0) { if(fastEMA < slowEMA) {    string strTrend = "DOWN";    // Open a sell trade here    OrdType = ORDER_TYPE_SELL; }
   
   double fastEMA = iMA(Symbol(), 0, FastEMA_Period, 0, MODE_EMA, PRICE_CLOSE);
   double slowEMA = iMA(Symbol(), 0, SlowEMA_Period, 0, MODE_EMA, PRICE_CLOSE);
   
   string strTrend = "";
   
   // BUY Signal
   if(fastEMA > slowEMA) {
      string strTrend = "UP";
      OrdType = OP_BUY;
   }
   
   // SELL Signal
   if(fastEMA < slowEMA) {
      string strTrend = "DOWN";
      // Open a sell trade here
      OrdType = OP_SELL;
   }

you have to fix OrdType for mql4

 
Nguyen Quoc Hung #:

it can be easily ... AK-47 Scalper EA - expert for MetaTrader 5 

Unfortunately, this code is not cross-platform.

 
It performed well however with a spread of 0.5, I would like to know if anyone has tested it with a setup with larger spreads.
 
i think you code in "stop level" not enough

double meybe?
 
Nguyen Quoc Hung #:

you have to fix OrdType for mql4

hello, could you please update the EA, so it would have an option to buy only or sell only.

Thank you in advance

 
Good day, i can't attach EA to real account. How do I rectify? Thank you so much
 
Nguyen Quoc Hung #:
You can try to use donchain indicator to get entry signal.
What is donchain Indicator