Best way for new chart creation

 

Dear Forum,

I was thinking lately how helpful it would be if I can create composites that are not offered by my broker. For example I'd like to create chart of AUDGBP by dividing AUDUSD with GBPUSD, and then if I see some technical setup at that composite it would be much easier to bring decision either for AUDUSD or GBPUSD. In that regard it would be also interesting to create charts of unrelated pairs. So I wonder if any of you has any idea what would be the best way to create new chart in MT4. Obviously, creating a line indicator that divides or multiplies the quotes would be an easy thing to do, but that would exclude candlestick analysis. How do you create candlesticks? Is drawing lines with different widths an option? Or is it better to create histograms (although I am not sure how that would be possible)?

Any ideas are welcome.

 

See heiken-ashi code for "how to make candlesticks" using indicator indexes

Or draw your own -- thin line object is a wick, thick line is a body.

I do both.

 

Is this possible? I tried to alter the heiken ashi code by enetering new values, but it printed histogram from 0 to the new value (mountain style chart).

 
Actually i tried it again, but it works only if the indicator is in the main chart (#property indicator_chart_window)
 

You would have to draw objects to create candles in an indicator subwindow

http://screencast.com/t/ODdiYzU0

 

Yeah, but this does not seem to work because it somehow does not receive the GBPUSD quotes on the AUDUSD chart.

It prints correctly if there is only one symbol, but when I add the second symbol nothing happens.

How do you solve this?

 

ALL of the built in functions that start with "i" -- iClose(), for example, can access any pair any timeframe any bar.

Also, MarketInfo() contains the current state for all pairs.

http://screencast.com/t/NWRmODhiNWEt

 

Actually as I suspected the reason why nothing showed up was the scale.


How did you solve this on the attached chart?

 

Scale --

Price movement on the chart for each of the two extra pairs is "relative" to a time point in the past.

The chart compares relative pip moves of pairB and pairC against moves of the chart pair from a specified starting time and price on the chart pair.

Get a list of prices for pairB and pairC and adjust them so they show on the chart with the main pair before drawing candles (using the adjusted prices).

.

// point data -- need to know when mixing 2 and 4 digit pairs
double basePoint     = MarketInfo(BaseSecurity, MODE_POINT);
double secondPoint   = MarketInfo(SecondSecurity, MODE_POINT);
// starting price
base1 = (iHigh(BaseSecurity,   0, startBar)+iLow(BaseSecurity,   0, startBar))/2;
//starting price pair2
base2 = ((iHigh(SecondSecurity,  0, iBarShift(SecondSecurity, 0, startTime)) + iLow(SecondSecurity,   0, iBarShift(SecondSecurity, 0, startTime)))/2);
// for each bar of pair2 -- this would be data to draw candles - these are the index buffers -- loop from the starting bar
if(iClose(SecondSecurity, 0, i) >= iOpen(SecondSecurity, 0, i)){
   high2[j]   =   (((iHigh(SecondSecurity, 0, i)) - base2) *(basePoint/secondPoint)) + base1;
   low2[j]    =    (((iLow(SecondSecurity, 0, i)) - base2) *(basePoint/secondPoint)) + base1;
   open2[j]   =   (((iOpen(SecondSecurity, 0, i)) - base2) *(basePoint/secondPoint)) + base1;
   close2[j]  =  (((iClose(SecondSecurity, 0, i)) - base2) *(basePoint/secondPoint)) + base1;
}
if(iClose(SecondSecurity, 0, i) < iOpen(SecondSecurity, 0, i)){
   low2[j]    =   (((iHigh(SecondSecurity, 0, i)) - base2) *(basePoint/secondPoint)) + base1;
   high2[j]   =    (((iLow(SecondSecurity, 0, i)) - base2) *(basePoint/secondPoint)) + base1;
   open2[j]   =   (((iOpen(SecondSecurity, 0, i)) - base2) *(basePoint/secondPoint)) + base1;
   close2[j]  =  (((iClose(SecondSecurity, 0, i)) - base2) *(basePoint/secondPoint)) + base1;
}
// Third pair repeat actions with pair3 data
 

Thax a lot fo your patience, but I'd like to know if

BaseSecurity is the chart of the pair the composite is applied to, right?

SecondSecurity is which one of the three?

Reason: