Making an Indicator involving price data from 2 different Currencies: How?

 

Hey,

I'd like to make an indicator that involves the ask price on another chart, is there any way to do that?

I know I can use MarketInfo("EURUSD",MODE_ASK) in an EA, but is there any way to do the same thing in an Indicator?

I'm trying to compare the price of another pair, wth the price on the chart the Indicator is attached too.

Thanks for the help,

Justin

 
sampson:
Hey,

I'd like to make an indicator that involves the ask price on another chart, is there any way to do that?

I know I can use MarketInfo("EURUSD",MODE_ASK) in an EA, but is there any way to do the same thing in an Indicator?

I'm trying to compare the price of another pair, wth the price on the chart the Indicator is attached too.

Thanks for the help,

Justin

Salam Justin,

You can use MarketInfo() function in an indicator very like using it in an EA.

But don't forget to use RefreshRates() function before it!

Example:

RefreshRates(); Alert(MarketInfo("USDCHF",MODE_ASK));
 

Thanks Mohammed. The problem is I want to draw a histogram and it seems like iLow, iHigh, iClose, etc will do what I want, I just couldn't find them until now.

Thanks again!

 
sampson:
Thanks Mohammed. The problem is I want to draw a histogram and it seems like iLow, iHigh, iClose, etc will do what I want, I just couldn't find them until now. Thanks again!

sampson,

You're welcome!

Could you tell me what exacly you want to do maybe I could help.

PS: iLow,iHigh,iClose ec are working for me like that:

Print("Current bar for USDCHF H1: ",iTime("USDCHF",PERIOD_H1,0),", ", iOpen("USDCHF",PERIOD_H1,0),", ",

iHigh("USDCHF",PERIOD_H1,0),", ", iLow("USDCHF",PERIOD_H1,0),", ",

iClose("USDCHF",PERIOD_H1,0),", ", iVolume("USDCHF",PERIOD_H1,0));
 

I think newdigital have posted and indicator to show 5 different pairs price on one same chart. I must find it first

 

This function is usefull

ArrayCopyRates(Array_Name, Symbol_Name, Period);

[new_bie_programmer]

 
firedave:
I think newdigital have posted and indicator to show 5 different pairs price on one same chart. I must find it first

Yes! I think this is the link:

https://www.forex-tsd.com/forum/debates-discussions/116-something-interesting-please-post-here/page3#comment_23408

 
Mohammed:
Yes! I think this is the link: https://www.forex-tsd.com/forum/debates-discussions/116-something-interesting-please-post-here/page3#comment_23408

Thank you Mohammed, you saved me All the best to you

 

Cool, thanks for the help guys. Those examples should be everything I need.

I'm making an indicator to do defacto-arbitrage between USD/CHF and EUR/USD.

Someone posted an EA yesterday and it got me thinking, I think it could be interesting.

I'll post my version of the EA, and an indicator soon as it's done.

 
sampson:
Cool, thanks for the help guys. Those examples should be everything I need.

I'm making an indicator to do defacto-arbitrage between USD/CHF and EUR/USD.

Someone posted an EA yesterday and it got me thinking, I think it could be interesting.

I'll post my version of the EA, and an indicator soon as it's done.

Salam sampson,

You're welcome!

Did you try my Ali EA. it has the same concept and the pairs (USDCHF & EURUSD).

I think if we can use the correlation and the hedging right we can trade trendlessly!

 
Mohammed:
Salam sampson,

You're welcome!

Did you try my Ali EA. it has the same concept and the pairs (USDCHF & EURUSD).

I think if we can use the correlation and the hedging right we can trade trendlessly!

Hi Mohammed, I think sampson got his new idea after seeing your Ali EA

Reason: