Wanted Inverted chart with values

amitrandive

Well-Known Member
#1
Dear All

I have USDEUR historical/live quotes data for Amibroker.

Can I get EURUSD chart from those quotes along with values in the chart?

I am trying to use the following code by Happy Singh as a template

Code:
_SECTION_BEGIN("Ulta_Sulta");
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
bkcolor = ParamColor("Bk Color",colorBlack);
SetChartBkColor(bkcolor) ;
reverse = ParamToggle("Rerverse Chart","NO|YES",1);
if(reverse)	{
	GraphXSpace =-100; 
	BarCol	=	IIf(C > O, colorRed, colorBlue); 
	SetBarFillColor(IIf(C > O, colorRed, bkcolor)); 
}
else {
	BarCol	=	IIf(C < O, colorRed, colorBlue); 
	SetBarFillColor(IIf(C < O, colorRed, bkcolor)); 
}
Plot( C, "Close", BarCol, styleCandle | styleNoTitle);  	
_SECTION_END();
Tried this also ,but do not know how to use that

http://www.amibroker.com/kb/2006/08/09/amibroker-for-forex/
 

casoni

Well-Known Member
#2
Hello Amit,
code you posted just reverses the color ,
You want to plot USDEUR and EURUSD on same chart [i.e two scripts in single chart ] ?

or Just Reverse chart of a script like this
 

amitrandive

Well-Known Member
#3
Hello Amit,
code you posted just reverses the color ,
You want to plot USDEUR and EURUSD on same chart [i.e two scripts in single chart ] ?

or Just Reverse chart of a script like this
Casoni

Thanks for the reply.

I have the quotes of USDEUR, I want to plot only a chart of EURUSD along with the values.
 

casoni

Well-Known Member
#4
Casoni

Thanks for the reply.

I have the quotes of USDEUR, I want to plot only a chart of EURUSD along with the values.
As far as i understand , you want to Plot [1] USDEUR and [2] EURUSD , [ as both are different instruments ], on same chart ?

Because inverting USDEUR , wont become EURUSD
 

amitrandive

Well-Known Member
#5
As far as i understand , you want to Plot [1] USDEUR and [2] EURUSD , [ as both are different instruments ], on same chart ?

Because inverting USDEUR , wont become EURUSD
I actually thought inverting USDEUR would become EURUSD.

Is it possible to do what you are suggesting,draw a chart of EURUSD from quotes of USDEUR?
 

casoni

Well-Known Member
#6
I actually thought inverting USDEUR would become EURUSD.

Is it possible to do what you are suggesting?

//plotting two different instruments/scripts on same chart
tickerA = ParamStr( "TickerA", "Nifty_F1" );
tickerB = ParamStr( "TickerB", "BankNifty_F1" );

Fa=Foreign(tickerA,"C");
Fb=Foreign(tickerB,"C");

PlotForeign( tickerA, "\nChart of "+tickerA,ParamColor( "Price ColorA", colorWhite ), styleLine |styleOwnScale);
PlotForeign( tickerB, "\nChart of "+tickerB,ParamColor( "Price ColorB", colorGreen ), styleLine |styleOwnScale);


//==============================================

//Inverting / Reversing a chart
Plot(C,"Normal Chart : "+Name(),colorGreen,styleBar|styleLeftAxisScale);
PlotOHLC(-O,-H,-L,-C,"Reverse Chart , "+Name(),colorRed,styleBar);
 

amitrandive

Well-Known Member
#7
//plotting two different instruments/scripts on same chart
tickerA = ParamStr( "TickerA", "Nifty_F1" );
tickerB = ParamStr( "TickerB", "BankNifty_F1" );

Fa=Foreign(tickerA,"C");
Fb=Foreign(tickerB,"C");

PlotForeign( tickerA, "\nChart of "+tickerA,ParamColor( "Price ColorA", colorWhite ), styleLine |styleOwnScale);
PlotForeign( tickerB, "\nChart of "+tickerB,ParamColor( "Price ColorB", colorGreen ), styleLine |styleOwnScale);


//==============================================

//Inverting / Reversing a chart
Plot(C,"Normal Chart : "+Name(),colorGreen,styleBar|styleLeftAxisScale);
PlotOHLC(-O,-H,-L,-C,"Reverse Chart , "+Name(),colorRed,styleBar);
Casoni

Thanks for these codes , but does not solve my issue.

My basic requirement is to plot a EURUSD chart using USDEUR quotes.I do not have EURUSD quotes

Thanks for looking into the issue.
 

mastermind007

Well-Known Member
#8
Casoni

Thanks for these codes , but does not solve my issue.

My basic requirement is to plot a EURUSD chart using USDEUR quotes.I do not have EURUSD quotes

Thanks for looking into the issue.
Does this help?

PlotOHLC(1/O,1/L,1/H,1/C,"Reverse Chart , "+Name(),colorRed,styleBar);
 
Last edited:

adityasaraf007

Well-Known Member
#9
I actually thought inverting USDEUR would become EURUSD.

Is it possible to do what you are suggesting,draw a chart of EURUSD from quotes of USDEUR?
Hi Amit ji..

Yes, you are correct in your understanding... Obviously, this would only give you approximate values, but with very close approximation..

Use the following to insert in its own panel:

Code:
_SECTION_BEGIN( "Inverse" );
SetChartOptions( 0, chartShowArrows | chartShowDates | chartWrapTitle | chartLogarithmic );

O = 1 / O;
C = 1 / C;
IH = 1 / L;
IL = 1 / H;
H = IH;
L = IL;

_N( Title = StrFormat( "{{NAME}} (Inversed) - {{INTERVAL}} {{DATE}} InvOpen %.4f%, InvHigh %.4f%, InvLow %.4f%, InvClose %.4f% (%.2f%%), {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );
Plot( C, "InvClose", colorDefault, styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );

_SECTION_END();
 

Similar threads