Questions from a "dummy" - page 92

 
sergeev:
So move it, or are you worried about the DLL support being turned off?
It's not a problem, the main thing is to have somewhere to put it. I am currently on 4 and I want to be ready for the moment when datetime will run out of digits :) or else I will be stuck with my DLL at a broken MT4 :)
 

Good afternoon.

I hope the author doesn't mind if I post in his thread.

I do not know how to write codes for EAs, so my question is, is there anyone willing to write an EA for me based on my thoughts and ideas?

I know it doesn't look good, but it's a big problem for me.

Thanks in advance to everyone who responds.

E-mail me privately or to filyaro@gmail.com

 
fill:

Good afternoon.

I hope the author does not mind if I post in his thread.

I do not know how to write codes for EAs, so my question is, is there anyone willing to write an EA for me based on my thoughts and ideas?

I know it doesn't look good, but it's a big problem for me.

Thanks in advance to everyone who responds.

E-mail me privately or to filyaro@gmail.com

You'd better go here https://www.mql5.com/ru/job
MQL5 работа
MQL5 работа
  • www.mql5.com
Заказы на разработку программ для трейдинга
 
sergey1294:
you're better off here https://www.mql5.com/ru/job
Thanks for the reply.
 
220Volt:
It's not a problem to transfer it, the main thing is to have somewhere to put it. I am currently on 4, and I want to be ready for the moment when datetime will run out of bits : ) or something else, and I will be left with my DLL at a broken MT4 :)

Well, it's too early to think about it.

void OnStart()
  {
    // 2147483647 максимум int
    // 1321048620 текущая дата (41 год от старта)
    Print(2147483647/1321048620.*41);
  }

66.65, there's still time to prepare, and the datetime is stored in ulong in five.

 
Urain:

Well, it's too early to think about it.

Really... I overreacted.
 
//falure swing, divergences/reversals, support/resistance lines, range shift (40-80 | 20-60), Cutler's RSI
#include <Trade\Trade.mqh>
CTrade Trade;
#include <Alphazavr\GetLotOnSTEPV.mqh>

input double                  Standart_tick_equity_percent_variation=   0.01;
input int                     RSI_sell_open_level=                      70;
input int                     RSI_buy_open_level=                       30;
input int                     RSI_buy_close=                            50;
input int                     RSI_sell_close=                           50;
input int                     RSI_EMA_averaging_period=                 14;
input ENUM_TIMEFRAMES         RSI_timeframe=                            PERIOD_M5;
input ENUM_APPLIED_PRICE      RSI_applied_price=                        PRICE_WEIGHTED;

double Lot=GetLotOnSTEPV(Standart_tick_equity_percent_variation);
int RSI_handle=iRSI(_Symbol,RSI_timeframe,RSI_EMA_averaging_period,RSI_applied_price);
double RSI_values[];
ArraySetAsSeries(RSI_values,true);
MqlRates Latest_rate[1];
void OnTick()
      {
      CopyRates(_Symbol,RSI_timeframe,0,1,Latest_rate);
      if(Latest_rate[0].tick_volume>1) return;
      CopyBuffer(RSI_handle,0,0,4,RSI_values);
      switch(PositionGetInteger(POSITION_TYPE))
            {
            case POSITION_TYPE_BUY:
                  if(RSI_values[0]<RSI_buy_close)
                        {
                        Trade.PositionClose(_Symbol,0);
                        }
                  break;
            case POSITION_TYPE_SELL:
                  if(RSI_values[0]>RSI_sell_close)
                        {
                        Trade.PositionClose(_Symbol,0);
                        }
                  break;
            }
      if(RSI_values[0]<RSI_values[1] && RSI_values[1]<RSI_values[2]/* && RSI_values[3]>RSI_sell_open_level && RSI_values[0]<RSI_sell_open_level*/)
            {
            Trade.PositionOpen(_Symbol,ORDER_TYPE_SELL,Lot,SymbolInfoDouble(_Symbol,SYMBOL_BID),0,0,NULL);
            }
      if(RSI_values[0]>RSI_values[1] && RSI_values[1]>RSI_values[2]/* && RSI_values[3]<RSI_buy_open_level && RSI_values[0]>RSI_buy_open_level*/)
            {
            Trade.PositionOpen(_Symbol,ORDER_TYPE_BUY,Lot,SymbolInfoDouble(_Symbol,SYMBOL_ASK),0,0,NULL);
            }
      }

Why does the compiler give an error?

'ArraySetAsSeries' - declaration without type RSI_tester.mq5 18 1

?

 
Alphazavr:

Why does the compiler give an error?

?

This operation cannot be done in global scoping.
Do the initialization in OnInit.
 

Thank you. Now there is another problem with the same EA. When you optimize parameters, the terminal does not make trades. It only makes them during normal testing (on the same timeframe and with the same parameters as during optimization tests).

I checked that optimization works fine for other EAs. So I'm screwing up something again.

 
Also, why does the terminal keep downloading the history? I am testing on the same pair, on the same server, the time frame does not include the last few days. Every time I start testing it downloads half a megabyte or so.