How to show MACD to another currency pair ? - page 2

Mladen Rakic
200848
Mladen Rakic  

...

OK. Lets try this way :

- 2 charts EURUSD and EURGBP

- on EURUSD 2 bars are changed

- on EURGBP 100 bars are changed

How many bars does the indicator have to recalculate?

Second case :

- on EURUSD 100 bars are changed

- on EURGBP 2 bars are changed

Now how many bars have to be recalculated now?

_______________________________

In both case it must be 100

_______________________________

That problem is solved with "asking" EURGBP chart how many bars it has changed and then using the bigger of the 2 : current chart changed bars and EURGBP changed bars. And you do not have to attach it to any other chart : the indicator is doing all that for itself

hope this helped

yuzs2000:
Dear Mladen,

please ,what's mean of this line code ? why does it try to compare symbol with "returnBars" ? should i attach another MACDTest with symbol="returnBars" on the current symbol?

returnBars = (symbol=="returnBars"); if (returnBars) return(0);
[Deleted]  

acushnir,thanks for your patience,i got it.

But one more question please,to my understanding,if for EURUSD, 2 bars are changed,i feel that EURGBP also have 2 bars changed since each bar garnered by each 15 mins(15 timeframe) even if there is no price changed,so i think the number of bars should be same regardless of whether it is EURUSD or EURGBP. Please advice me.

acushnir:
I changed a bit and I tested it and works fine to me:

I've used a EURUSD chart and I've choosed USDCHF for the indicator.

To be sure, then I've opened a USDCHF chart and attached a standard MACD indicator and the figures match perfectly

Check it :-)

Best regards and happy trading!!!

mladen:
OK. Lets try this way :
- 2 charts EURUSD and EURGBP

- on EURUSD 2 bars are changed

- on EURGBP 100 bars are changed

How many bars does the indicator have to recalculate?

Second case :

- on EURUSD 100 bars are changed

- on EURGBP 2 bars are changed

Now how many bars have to be recalculated now?

_______________________________

In both case it must be 100

_______________________________

That problem is solved with "asking" EURGBP chart how many bars it has changed and then using the bigger of the 2 : current chart changed bars and EURGBP changed bars. And you do not have to attach it to any other chart : the indicator is doing all that for itself

hope this helped
Mladen Rakic
200848
Mladen Rakic  

...

It is not so

1. Ticks for different symbols do not have to came at the same time at all

2. Imagine that you did not look at the EURGBP for a month - how many bars will be changed in your chart when you call this indicator? You can have cases when you did not load the target symbol at all and then you will have that 2 bars changed for EURUSD and "max bars on chart" (let it be 5000 as an example) in the other symbol changed.

3. Due to different ticks (price changes) there can even be a difference in bar numbers (some symbol can even lack a bar where the other has it)

Each symbol "has a life of its own". They do not have to be synchronized (in the times of change) at all. It is not working on a "generate a tick per nnn seconds or milliseconds, but a tick is generated if the price have changed. So, treat each and every symbol as a complete different entity

yuzs2000:
acushnir,thanks for your patience,i got it. But one more question please,to my understanding,if for EURUSD, 2 bars are changed,i feel that EURGBP also have 2 bars changed since each bar garnered by each 15 mins(15 timeframe) even if there is no price changed,so i think the number of bars should be same regardless of whether it is EURUSD or EURGBP. Please advice me.
[Deleted]  

Hi mladen,i did test your MACDTest indicator with demo account,it works well.but when i tried to do Backtesting with history data,the wrong chart again...

How did you test it ? does it work well with history at your machine ?

Thanks!

mladen:
It is not so
1. Ticks for different symbols do not have to came at the same time at all

2. Imagine that you did not look at the EURGBP for a month - how many bars will be changed in your chart when you call this indicator? You can have cases when you did not load the target symbol at all and then you will have that 2 bars changed for EURUSD and "max bars on chart" (let it be 5000 as an example) in the other symbol changed.

3. Due to different ticks (price changes) there can even be a difference in bar numbers (some symbol can even lack a bar where the other has it)

Each symbol "has a life of its own". They do not have to be synchronized (in the times of change) at all. It is not working on a "generate a tick per nnn seconds or milliseconds, but a tick is generated if the price have changed. So, treat each and every symbol as a complete different entity
Mladen Rakic
200848
Mladen Rakic  

...

Use this one

Also make sure that you have data for the target symbol (EURGBP by default) downloaded for the period you are testing too) Otherwise you are nt going to get data calculated in the back test (back test does not work as the run-time normal execution)

yuzs2000:
Hi mladen,i did test your MACDTest indicator with demo account,it works well.but when i tried to do Backtesting with history data,the wrong chart again...

How did you test it ? does it work well with history at your machine ?

Thanks!
Files:
[Deleted]  

wow ,great!! it works well with history data! Mladen, i appreciate your help!

mladen:
Use this one Also make sure that you have data for the target symbol (EURGBP by default) downloaded for the period you are testing too) Otherwise you are nt going to get data calculated in the back test (back test does not work as the run-time normal execution)