Toys from Vinin - page 23

 
Vinin:


It can also be simpler. Use iRSI()

double iRSI( string symbol, int timeframe, int period, int applied_price, int shift)

Relative Strength Index calculation.

RSI=iRSI(NULL, 0, RSI_Period, PRICE_CLOSE,1);
if (RSI>50.0) {return(BULL);}
f (RSI<0.0) {return(BEAR);}
Thanks, I don't need it any easier... Just interested in importing parameters from the indicator... maybe i'll practice signals from other non built-in indicators - modified stochastics, momentum, volatility indicators and other stuff with simple take or buy logic... just like EA template and as a pattern so to speak... want to check other indicators compared to mashka ones...
https://book.mql4.com/ru/samples/shared here's a look...
It will look like this according to the tutorial :
double iCustom(string symbol, int timeframe, string name, ..., int mode, int shift)


double iCustom( 0, 0 , "+RSI-TC" , RSI(1), int mode, int shift)
what should be the indicator line index and shift?

 
Rossi:


Then you can change it a bit

RSI=iCustom(NULL, 0, "+RSI-TC", RSIPeriod, BullLevel, BearLevel, AlertOn,0,1);
if (RSI>50) return(BULL);
if (RSI<50) return(BEAR);
 
Vinin:


Then you can change it a bit.


Thanks.

instead of RSIPeriod I should use 1 and RSI will be set to RSI = RSI(1) ?

Should I set BullLevel, BearLevel as extern double in the EA and set it to 50.0 ?

 
Rossi:


thanks a lot

should I replace RSIPeriod with 1 and then RSI will be assigned RSI = RSI(1) ?

and BullLevel, BearLevel, should I set in the EA as extern double? and set 50.0 ?


Have you looked at the indicator? RSIPeriod is the calculation period.

iCustom() is something i should know better ?

 
Vinin:


Have you looked at the indicator? RSIPeriod is the calculation period.

And iCustom() should be studied more closely.


I don't understand the logic at first, why RSI is assigned there ? and not another array's value for example...

memories from another language...

I would implement it this way: RSI = iCustom(RSI (1), 0, 0, "+RSI-TC", RSIPeriod, BullLevel, BearLevel, AlertOn,0,1);
for example, it assigns to the local variable the first digit of the string of the indicator... that's just the way it is... with its charter...

 
VininI_AAA_12.1_.mq4 is almost identical to MA17LW-Open, and if you add MA17Ex-Close, or Simple would be the system
 
med1um:
VininI_AAA_12.1_.mq4 is almost identical to MA17LW-Open, and if you add MA17Ex-Close, or Simple will be the system

Decipher it a bit. If you don't mind of course
 
Vinin:

Explain it a little. If you don't mind.

MA17

MA method: Linear Weighted

apply to: Open

if you look at intersections with VininI_AAA_12.1_.mq4, you get good outputs, and sometimes even inputs,

and if we apply MA17EXpotential-Close to VininI_AA_12.1_.mq4, the colour changes and crossovers are almost the same as MA17LW-Close and MA17Ex-Open crossovers

 

VininI_AAA_12.1_.mq4 attempt to make something universal. You can make both HMA and LRMA from it. And it can do many other things. It is only necessary to set appropriate parameters.

 
Vinin:

VininI_AAA_12.1_.mq4 attempt to make something universal. You can make both HMA and LRMA from it. It can do many other things as well. It is only necessary to set appropriate parameters.

I just mean that you can trade it as one of positions, e.g. the longest (I usually use such holds as the 3rd position after the 1st signal and the 2nd breakeven)