Download MetaTrader 5
To add comments, please log in or register
Write articles and earn money. We pay 200 USD for them!
MariopNew
57
MariopNew 2014.10.26 22:04 

Hi everyone,

I'm trying to get price information of a symbol from the inside of a custom indicator which is loaded on another symbol.

Actually I've tried different combinations of custom indicators/symbols and I can't get the "another symbol rates" to correctly get updated, in order to get, for example, the AUDUSD Close[1] from a indicator loaded on the EURUSD.

Any idea on how to get it?

Thanks.

Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.10.26 22:17  
Mariop:


Hi everyone,

I'm trying to get price information of a symbol from the inside of a custom indicator which is loaded on another symbol.

Actually I've tried different combinations of custom indicators/symbols and I can't get the "another symbol rates" to correctly get updated, in order to get, for example, the AUDUSD Close[1] from a indicator loaded on the EURUSD.

Any idea on how to get it?

Thanks.

iClose(OtherSymbol, Timeframe, Shift) ?
MariopNew
57
MariopNew 2014.10.26 22:46  

Hi Raptor,

Thaks for your quick response.

Exactly; that should work fine, but it's like if the rates of the "other" symbol would freeze.

I mean: If I load the indicator on the current (simulation) chart, it displays correctly, but when I click "play", and rates of current symbol go on, if I use:

Print("Current value= "+iClose(OtherSymbol, 0, 0));

It will show in each new bar, the very same value as when I loaded the indicator, so I get a horizontal line instead of the correct graph.

I've tried using "RefresRates()", just to try, but it changes nothing.

I guess I'm missing something, but  I don't know what could it be though I'm not a newbie :S

By the way, I'm doing this just to be able to watch the indicator during the visual simulation, (not just at the end of it), so any other way of doing it would help me, but I would like to know how to do it this way, since I'm quite sure it's something I should know and I don't.

Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.10.26 22:56  
Mariop:

Hi Raptor,

Thaks for your quick response.

Exactly; that should work fine, but it's like if the rates of the "other" symbol would freeze.

I mean: If I load the indicator on the current (simulation) chart, it displays correctly, but when I click "play", and rates of current symbol go on, if I use:

Print("Current value= "+iClose(OtherSymbol, 0, 0));

It will show in each new bar, the very same value as when I loaded the indicator, so I get a horizontal line instead of the correct graph.

I've tried using "RefresRates()", just to try, but it changes nothing.

I guess I'm missing something, but  I don't know what could it be though I'm not a newbie :S

By the way, I'm doing this just to be able to watch the indicator during the visual simulation, (not just at the end of it), so any other way of doing it would help me, but I would like to know how to do it this way, since I'm quite sure it's something I should know and I don't.

The Strategy Tester is for testing Strategies . . .  EAs,  not Indicators, it will work with many Indicators, and others partly . . don't rely on it.   If you f=don't have the data for the other Symbol for the date you are trying to get the data for then you won't get the correct data.
MariopNew
57
MariopNew 2014.10.26 23:36  

It doesn't seem to be a data feed problem:

I'm using  that "Print" inside the Start() of the indicator, and it get the correct values if the indicator is used from the EA being tested, but if I drag and drop the indicator on the chart, to be able to watch it, this instance of the indicator doesn't work.

It's like if being called from the EA would allow the indicator to access the data and/or being dragged to the chart wouldn't. Why could it be? Why would the indicator called from the EA get the correct (updated) data and the "added" indicator wouldn't?

/
To add comments, please log in or register