ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  How to draw attached Financial Chart
Posted by peter on Jun-11-2014 22:16
Attachments:
Hi,

I want to create a Financial Chart like attached file.

I have some questions.

1.for the 3 indicators.(Similar but different parameters)
   If the indicator's value >70, I want to draw a red up arrow.
   If the indicator's value > 75, I want to draw a red ball.
   If the indicator's value > 80, I want to draw a smile bmp.
   If the indicator's values crossed, I have to draw a cross symbol.

   Would you mind give me a simple code example to do my work?

   Following is my stupid thought.
   I checked the ScatterLayer and I thought that I have to check all series from the beginning to create as many scatterlayer for different symbols.
   a.check indicator 1 values, from the beginning bar to last bar.
   b.if indicator 1 value > 80 add a scatterlayer with smile bmp which the datasetx exist.
      if indicator 1 value <= 80 then the datasetx for this sactterlayer is none.
   c. repeatly checking indicator 1 value for > 75 then > 70 then cross to add 3 other scatterlayers.

   will this work? are there any better solution?

2.for the main chart.
   I have green ball and blue ball on top of the chart should be shown if some requirement meet.
   Should I add another 2 scatterlayers like 1?
   If I need to add other symbols on different MAs if some requirement meet, too.
   Same method?

3.for the main chart.
   If I need to draw smile  or cry bmp on chart which represents for some Trading Stratey(Buy Sell).
   Add a Buy scatterlayer and a Sell scatterlayer?

Thank you for your help.

Peter
BL.png

  Re: How to draw attached Financial Chart
Posted by Peter Kwan on Jun-12-2014 05:56
Hi Peter,

The method you mentioned is in fact our recommended methods to add symbols to the
charts. For example, in Java, it is like:

//Assume the red up arrow occurs when myIndicator > 70, and the arrow is at the same
//position as the myIndicator.
double[] redUpArrows = new double[closeData.length];
for (int i = 0; i < closeData.length; ++i)
    redUpArrows[i] = (myIndicator[i] > 70) ? myIndicator[i] : Chart.NoValue;

myMainPriceChart.addScatterLayer(null, redUpArrows, ......);

You can repeat the above code for all symbols in your chart. Basically, you just change the
condition on when the symbol occur, and where does it occur. You can use simple
conditions like checking if the indicator is larger than certain value, or other complex
conditions. (Many of our customers have "secret" or proprietary formulas for determining
"Buy" and "Sell" positions.)

Hope this can help.

Regards
Peter Kwan