Download MetaTrader 5

RSI EA and Applied Price?

To add comments, please log in or register
Jilles Leuven
434
Jilles Leuven  

Hi,

I hope somebody  can explain it to me, I don't understand what applied price means in this situation. Let me tell you what the problem is.....

I have an EA based on OB and OS levels of RSI. I want into the trade as soon the candle is closed. Not before!
Therefore I was thinking I use Applied Price "0" because this means Close, right?
However, every time when I use "0" I am going into the trade at once in the current Candle when there is a signal of OB or OS levels, I mean the trade is opened but the Candle is not closed yet.

When I am using "1" which means "Open" in that case it seems that when the previous candle is closed as soon the next candle starts I am going into position.

Especially condition "0" is very confusing for me. Please, can somebody explain it to me. I appreciate. I think I have to use "1" here or do I have to choose another condition? 2, 3, 4?

Thanks a lot.
Johan 

Marco vd Heijden
Moderator
5564
Marco vd Heijden  
ENUM_APPLIED_PRICE

ID

Description

PRICE_CLOSE

Close price

PRICE_OPEN

Open price

PRICE_HIGH

The maximum price for the period

PRICE_LOW

The minimum price for the period

PRICE_MEDIAN

Median price, (high + low)/2

PRICE_TYPICAL

Typical price, (high + low + close)/3

PRICE_WEIGHTED

Average price, (high + low + close + close)/4


so for the current bar or bar 0 there is no close available simply because it is always open, and once a bar shift happens, the close value of bar 0 shifts to bar 1 therefore it isn't possible to get the close price for bar 0 simply because that would be similar to looking into the future, so you can for example store the close value of bar 1 and constantly compare it to the actual value by a != is not equal to comparison then when bar 0 closes it will shift it's closing price to bar 1 and that will be noticed by your comparison unless the price stays exactly the same, which rarely happens and so you can use that to open your order and then overwrite the stored value of bar 1 to wait for next shift.

Jilles Leuven
434
Jilles Leuven  

Hi Marco,

Thanks for trying to explain but I really don't understand, maybe a little bit. It is obvious that "0" is not good because it is always the current Bar and there is no close for it. But what do I have to use, that is still the question...... 

Alain Verleyen
Moderator
33370
Alain Verleyen  
Jilles Leuven:

Hi Marco,

Thanks for trying to explain but I really don't understand, maybe a little bit. It is obvious that "0" is not good because it is always the current Bar and there is no close for it. But what do I have to use, that is still the question...... 

Applied price has nothing to do with "as soon the candle is closed". It's the price on which the RSI is calculated.

If you want to trade on close you have to detect new candle and use the RSI value on candle 1 (0 being current candle).

Please show your code if you need coding help.

Jilles Leuven
434
Jilles Leuven  
Thanks Alain, in that case I think the best way to do is using "1", right? Because I want to have some "confirmation" when opening the trade. I will check in the charts if that's what I want. It is still confusing for me.
Alain Verleyen
Moderator
33370
Alain Verleyen  
Jilles Leuven:
Thanks Alain, in that case I think the best way to do is using "1", right? Because I want to have some "confirmation" when opening the trade. I will check in the charts if that's what I want. It is still confusing for me.
Yes candle 1, provided you use on a new bar.
Marco vd Heijden
Moderator
5564
Marco vd Heijden  

yes that is what i meant so you store the value of candle 1 in a double and keep comparing it to the actual value of candle one and as soon as it changes you will know there was a new candle.

then you overwrite the double with the new value of candle one and repeat the cycle until it changes again and so on.

Jilles Leuven
434
Jilles Leuven  
Marco, too complicated..... I only want to know what value I have to choose in RSI applied Price in my situation. Now I am starting doubt again....
Which value do I need? "1" "2" or whatever, in any case no "0".
Marco vd Heijden
Moderator
5564
Marco vd Heijden  

if does not matter, you are mixing things, you want it to open order only when the new bar arrives but this has got nothing to do with the applied price...

the applied price is only applied to draw the rsi indicator value from.

so you mix: new bar ,

with: applied price for rsi.

these are two different things all together. 


first you make sure you got the triggers for rsi < low and rsi > high when it should order.

then you add to that wait for new bar so it orders only on new bar.

maybe i miss understood you.

Alain Verleyen
Moderator
33370
Alain Verleyen  
Jilles Leuven:
Marco, too complicated..... I only want to know what value I have to choose in RSI applied Price in my situation. Now I am starting doubt again....
Which value do I need? "1" "2" or whatever, in any case no "0".
Show your code !
Jilles Leuven
434
Jilles Leuven  

Thank you both but I am not a programmer. However it is obvious now that for the "best results" I have to choose for "0" because with this setting I get the signals as fast as possible. Risk is relative because I am using it on a 1M.

Which value you use here, it is always high risk ;-) When I am using "1" or other settings the signal will come a little later, of course! I understand. Confirmation doesn't mean much with very fast timeframes, does that make sense.

 Regards,
Johan 

12
To add comments, please log in or register