'MA200' - unexpected token - page 2

 
Kenneth Parling:

Here you go, i fixed it all for you ;)

YOU ARE REALLY KIND!!!

I have tested it but it doesent oper any positions

 
DAVIDE MAISANO:

YOU ARE REALLY KIND!!!

I have tested it but it doesent oper any positions

i have tested it and it does actually

 

check tester balance and the lot you are testing it with...to small balance for 1.0 lot and it won't work of course

 
Kenneth Parling:

check tester balance and the lot you are testing it with...to small balance for 1.0 lot and it won't work of course

I have modified everything. Lots 0.05, SL 10, TP 60, RSI 14

I don't know why

 
DAVIDE MAISANO:

I have modified everything. Lots 0.05, SL 10, TP 60, RSI 14

I don't know why

i have modified it some :-P and tested it and it trades....do what you want with it as it's not exactly as you had it made in the first place

#property copyright ""
#property link      ""
#property version   "1.00"
#property strict

int Magic=1234;
extern double   TakeProfit=12.0;
extern double   StopLoss=15.0;
extern double   Lots=1.0;
int ticket=0,_digits;
double PT,_point;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   _point = MarketInfo(Symbol(),MODE_POINT);
   _digits = (int)MarketInfo(Symbol(),MODE_DIGITS);
   if((_digits==5||_digits==3))
      PT=_point*10;
   else
      PT=_point;
//---

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   //double currentprice= Open[0];
   double MA200=iMA(Symbol(),PERIOD_CURRENT,200,0,0,0,0);
   double RSI1CUSTOM=iRSI(Symbol(),PERIOD_CURRENT,14,PRICE_CLOSE,1);
//---
   if(positions()==0)
     {
      if((Open[1]>MA200 && Close[1]<MA200)&&(RSI1CUSTOM<=30))
         ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,5,Bid+StopLoss*PT,Bid-TakeProfit*PT,"",Magic,0,Red);
     }
//---
   if(positions()==0)
     {
      if((Open[1]<MA200 && Close[1]>MA200)&&(RSI1CUSTOM>=70))
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,5,Ask-StopLoss*PT,Ask+TakeProfit*PT,"",Magic,0,Green);
        }
   return;
  }
//+------------------------------------------------------------------+
int positions()
  {
   int pos=0;
   for(int k = OrdersTotal() - 1; k >= 0; k--)
     {
      if(!OrderSelect(k, SELECT_BY_POS))
         break;
      if(OrderSymbol()!=Symbol()&&OrderMagicNumber()!=Magic)
         continue;
      if(OrderCloseTime() == 0 && OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
        {
         if(OrderType() == OP_BUY)
            pos = 1; //Long position
         if(OrderType() == OP_SELL)
            pos = -1; //Short positon
        }
     }
   return(pos);
  }
//+------------------------------------------------------------------+
 
Kenneth Parling:

i have modified it some :-P and tested it and it trades....do what you want with it as it's not exactly as you had it made in the first place

Thanks but it was my first EA end i've think to do this project:

For you I think is too easy. Can you help me?

Description:

Ea must open buy and sell orders based on RSI and Moving Average Indicators. 

Buy Orders Logic:

1. Orders are opened after the close of signal candle.

2. Buy orders are opened only if the price is above Moving average.

3. RSI indicator return back from oversold level, position is opened on close of candle that touches the 30's level returning back from RSI oversold level.

4. Preset Stop loss and Take profit.

5.  Lot size is determined by % of account if stop loss is hit.

 

Sell Orders Logic:  Reverse of buy.

 Running in 3 different TF at the same time: M3,M5,M15

 

Parameters for optimization:

1.Moving average

2. RSI Settings and levels

3. Stop Loss (customizable for the 3 different timeframe)

4. Take profit (customizable for the 3 different timeframe)

5. Account size, % of account at risk based on stop loss, option for manual account size input.



 
DAVIDE MAISANO:

Thanks but it was my first EA end i've think to do this project:

For you I think is too easy. Can you help me?

Description:

Ea must open buy and sell orders based on RSI and Moving Average Indicators. 

Buy Orders Logic:

1. Orders are opened after the close of signal candle.

2. Buy orders are opened only if the price is above Moving average.

3. RSI indicator return back from oversold level, position is opened on close of candle that touches the 30's level returning back from RSI oversold level.

4. Preset Stop loss and Take profit.

5.  Lot size is determined by % of account if stop loss is hit.

 

Sell Orders Logic:  Reverse of buy.

 Running in 3 different TF at the same time: M3,M5,M15

 

Parameters for optimization:

1.Moving average

2. RSI Settings and levels

3. Stop Loss (customizable for the 3 different timeframe)

4. Take profit (customizable for the 3 different timeframe)

5. Account size, % of account at risk based on stop loss, option for manual account size input.



no way i will build a whole ea for you...use Freelance for that

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • www.mql5.com
Hi Vladimir, I will need your assistance with another expert advisor as past projects. The purpose of this project will be similar to others to ensure minimum DD. I will provide all necessary files and documentation on the EA. Will need your help in converting EA to open prices only for faster testing The EA should do the following: Enter a...
 
Kenneth Parling:

no way i will build a whole ea for you...use Freelance for that

It may will be profitable for both of us

 
DAVIDE MAISANO:

It may will be profitable for both of us

sorry but i don't work like that. I've sent you a PM ;-)

 

here's someone willing to code it for free....

https://www.mql5.com/en/forum/335263

Write ea for free
Write ea for free
  • 2020.03.19
  • www.mql5.com
I have written hundreds of EAs for traders. No matter how complicated they can be, I can write them if necessary...
Reason: