[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 388

 
// < 0 - Dn
// > 0 - Up
int Signal()
{
double RSI = iRSI(NULL,15,RSIperiod,RSI_price,SignalBar);
double Stoch = iStochastic(NULL,15,Stoch_K,Stoch_D,Stoch_slowing,Stoch_method,Stoch_price,Stoch_mode,SignalBar);
double CCI = iCCI(NULL,15,CCI_period,CCI_price,SignalBar);

double MA2 = iMA(NULL,15,ma2_period,ma2_shift,ma2_method,ma2_price,SignalBar);
double IchiA = iIchimoku(NULL, 15, tenkan, kijun, senkou_span_b, 3, SignalBar);
double IchiB = iIchimoku(NULL, 15, tenkan, kijun, senkou_span_b, 4, SignalBar); 

    if(GO && SignalType_1 && RSI >= 65 && Stoch >= 80 && CCI >= 100) {GO=false; return(+1);}//запретить повторный вход (+1);
    if(GO && SignalType_2 && Bid >= MA2 && RSI >= 65 && Stoch >= 80 && CCI>=100) {GO=false; return(+1);}//запретить повторный вход return(+1);
    if(GO && SignalType_3 && Bid >= IchiA && RSI >= 65 && Stoch >= 80 && CCI>=100) {GO=false; return(+1);}//запретить повторный вход (+1);
    
   
    
    if(GO && SignalType_1 && RSI <= 35 && Stoch <= 20 && CCI <= -100) {GO=false; return(-1);}//запретить повторный вход (-1);
    if(GO && SignalType_2 && Ask <= MA2 && RSI <= 35 && Stoch <= 20 && CCI <= -100) {GO=false; return(-1);}//запретить повторный вход (-1);
    if(GO && SignalType_3 && Ask <= IchiB && RSI <= 35 && Stoch <= 20&& CCI <= -100) {GO=false; return(-1);}//запретить повторный вход (-1);
    
    if(OrdersTotal()==0)GO=true;
    
    return(0);
}
DhP:

Hello. Nothing's working. I'm sorry. It's fine. I just got confused. Thank you very much.
 
Hello. The iMaOnArray function uses a pre-prepared array of data, which is written in this function without square brackets. What if this array is two-dimensional? (e.g. Mas[4][100], i.e. 4 independent arrays of 100 points each)
 

Gentlemen programmers how to make it so that only the points of max and min candles of the same colour were displayed?

Decompiled deleted

 

Can you tell me if the profit factor is counted correctly if the Hist-array contains the account history after each closed trade.

double IndFunc2()
{
int i;
double sl,tp;
double r;
for(i=PeriodPF-1;i>0;i--){
r=Hist2[i]-Hist2[i-1];
if(r>=0){tp+=r;}
if(r<0){sl+=MathAbs(r);}
}
if(sl!=0){PF2=tp/sl;}
else{PF2=tp;}
return(0);
}
 
// < 0 - Dn
// > 0 - Up
int Signal()
{
double RSI = iRSI(NULL,15,RSIperiod,RSI_price,SignalBar);
double Stoch = iStochastic(NULL,15,Stoch_K,Stoch_D,Stoch_slowing,Stoch_method,Stoch_price,Stoch_mode,SignalBar);
double CCI = iCCI(NULL,15,CCI_period,CCI_price,SignalBar);

double MA2 = iMA(NULL,15,ma2_period,ma2_shift,ma2_method,ma2_price,SignalBar);
double IchiA = iIchimoku(NULL, 15, tenkan, kijun, senkou_span_b, 3, SignalBar);
double IchiB = iIchimoku(NULL, 15, tenkan, kijun, senkou_span_b, 4, SignalBar); 

    if(GO && SignalType_1 && RSI >= 65 && Stoch >= 80 && CCI >= 100) {GO=false; return(+1);}//запретить повторный вход (+1);
    if(GO && SignalType_2 && Bid >= MA2) {GO=false; return(+1);}//запретить повторный вход return(+1);
    if(GO && SignalType_3 && Bid >= IchiA) {GO=false; return(+1);}//запретить повторный вход (+1);
    
   
    
    if(GO && SignalType_1 && RSI <= 35 && Stoch <= 20 && CCI <= -100) {GO=false; return(-1);}//запретить повторный вход (-1);
    if(GO && SignalType_2 && Ask <= MA2) {GO=false; return(-1);}//запретить повторный вход (-1);
    if(GO && SignalType_3 && Ask <= IchiB) {GO=false; return(-1);}//запретить повторный вход (-1);
    
    if(OrdersTotal()==0)GO=true;
    
    return(0);
}

Hello Can you please advise how to split these signals into three different ones (i.e. the EA uses three buy signals, I want all three signals to be used by the EA separately and not in one pile) I tried it myself and got this

//+------------------------------------------------------------------+
//
// 1 - Dn
// 2 - Up
int Signal()
{
double RSI = iRSI(NULL,15,RSIperiod,RSI_price,SignalBar);
double Stoch = iStochastic(NULL,15,Stoch_K,Stoch_D,Stoch_slowing,Stoch_method,Stoch_price,Stoch_mode,SignalBar);
double CCI = iCCI(NULL,15,CCI_period,CCI_price,SignalBar);

if(GO && SignalType_1 && RSI >= 65 && Stoch >= 80 && CCI >= 100) {GO=false; return(+1);}//запретить повторный вход (+1);
else {
if(GO && SignalType_2 && RSI <= 35 && Stoch <= 20 && CCI <= -100) {GO=false; return(-1);}//запретить повторный вход (-1);
}
}

{
double MA2 = iMA(Symbol(), 0, 200, 0, MODE_EMA, PRICE_CLOSE, 1);


if(GO && SignalType_1 && Bid >= MA2) {GO=false; return(+1);}//запретить повторный вход (+1);

else
{
if(GO && SignalType_2 && Ask <= MA2)  {GO=false; return(-1);}//запретить повторный вход (-1);
}
}
{
double IchiA = iIchimoku(NULL, 15, tenkan, kijun, senkou_span_b, 3, SignalBar);
double IchiB = iIchimoku(NULL, 15, tenkan, kijun, senkou_span_b, 4, SignalBar); 

    
       if(GO && SignalType_1 && Bid >= IchiA ){GO=false; return(+1);}//запретить повторный вход (+1); 
  
  else{  
    
    if(GO && SignalType_2 && Ask <= IchiB ) {GO=false; return(-1);}//запретить повторный вход (-1); 
    }
    
    if(OrdersTotal()==0)GO=true;
    
    return(0);
}

And it turned out that the EA opens deals only on RSI CCI and Stoh. What is wrong?

 
FAQ:

Welcome, because the old one is slowing down immensely.

Link to previous top : https://www.mql5.com/ru/forum/134688


Good day, Dear forum users!

Not so long ago, I could hardly imagine how to write an EA at all. And now, I decided to write my first EA, my head got a great idea. Let's get to the point!

One of the functions of my EA is to scroll through the history looking for the last closed order, but the problem is that this order must be necessarily BUy or Sell, but not a deleted pending order. I am stumped. Originally I had the following construction

OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY);

The code is simple, it calculates the last order, but if the order is pending, then stupor(

I need code of the following form:

tra-la-la loop (reads from the end)

if I get a pending order {then 1 upwards},

if I get an order like BUY or SELL, voila {some function}

I hope for your help, the EA is almost completely written, my first creation, only this big joint is left, and the other small ones are nonsense.

Thanks in advance!!!
 
tyler.lexx:

Good day, Dear forum users!!!

Just recently, I had a hard time imagining how to write an EA. And now, I decided to write my first EA, and a bright idea just came to my mind. Let's get to the point!

One of the functions of my EA is to scroll through the history looking for the last closed order, but the problem is that this order must be necessarily BUy or Sell, but not a deleted pending order. I am stumped. Originally I had the following construction

OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY);

The code is simple, it calculates the last order, but if the order is pending, then stupor(

I need code of the following form:

tra-la-la loop (reads from the end)

if I get a pending order {then 1 upwards},

If I get an order like BUY or SELL, voila {some function}

I hope for your help, the EA is almost completely written, my first creation, only this big bug is left, and the other small ones are nothing.

Thanks in advance!!!

Spammy? If you do it again, get banned.
 
Vinin:

Spamming? If it happens again, you get banned.
If you're so smart, you'd better help me instead of scaring me about the end of the world! I actually asked for help!
 
I have a list of numbers and would like to plot the density of the distribution using some simple free program, as I'm not a mathematician myself, can you tell me where I can find such a program?
 
Doesimporting history no longer work or what? Build 434.