Profile Picture

Is it possible to decorate/modify the charts through code?

Posted By snackly 8 Years Ago

Is it possible to decorate/modify the charts through code?

Message
Posted Monday March 16 2009
I'd like to be able to notate the charts in realtime as I process market data. Is this possible to do through the API?
Posted Tuesday March 17 2009
There are a bunch of chart objects you can create in the RightEdge.Common.ChartObjects namespace.  The sample systems installed with RightEdge include some samples of how to use them.  To ensure that an existing chart object is updated, call it's Refresh method.

The code below shows how to create a text label that moves with the current price each time a new tick comes in:

ChartText Text = null;

public override void Startup()

{          

      Text = new ChartText(new ChartPoint(SystemData.TradeStartDate, 0), "X", Color.Red);

           

      // Set the font (optional)

      Text.LabelFont = new Font("Verdana", 9.0f, FontStyle.Bold);

 

      SystemData.ChartObjects.Add(Symbol, Text);

}

 

public override void NewTick(BarData partialBar, TickData tick)

{

      Text.Points[0] = new ChartPoint(partialBar.PriceDateTime, partialBar.Close);

      Text.Refresh();

}

Thanks,
Daniel

Posted Friday March 27 2009
When using these chart objects, can you put an object on only one chart? For instance if you have two MSFT charts open, and you add a line object, can you add it only to one of the two MSFT charts? Or will it be automatically added to all chart windows that are plotting MSFT?
Posted Friday March 27 2009
Are you talking about programatically or through the system? In the system, when you create chart objects, they're applied at the symbol/frequency level. If you're referring to outside of a system by drag and drop then that's a one to one operation.

greencap (3/27/2009)
When using these chart objects, can you put an object on only one chart? For instance if you have two MSFT charts open, and you add a line object, can you add it only to one of the two MSFT charts? Or will it be automatically added to all chart windows that are plotting MSFT?
Posted Friday March 27 2009
billb (3/27/2009)
Are you talking about programatically or through the system? In the system, when you create chart objects, they're applied at the symbol/frequency level. If you're referring to outside of a system by drag and drop then that's a one to one operation.

greencap (3/27/2009)
When using these chart objects, can you put an object on only one chart? For instance if you have two MSFT charts open, and you add a line object, can you add it only to one of the two MSFT charts? Or will it be automatically added to all chart windows that are plotting MSFT?


I mean programatically. You're saying I can't through code place a line object on just one MSFT chart, it will be foreced to show up on all MSFT charts?
Posted Sunday March 29 2009
There will be at most one MSFT chart associated with the system.  The objects you create in your system will show up on that chart but not any of the others.

You can open quick charts from the watch list but they won't show any of the trades, indicators, or chart objects from your system.  If you run a simulation, then you can go to the symbol results tab and double click on a symbol to open its chart (you can also double-click on a trade in the trade list).  This will display a chart with just the data that was used in the simulation, along with your indicators, chart objects, and trades (if you have them enabled).

If you are streaming live data you can open up a live chart for a symbol by double clicking on the symbol in the live data pane.  If you are running a live system, then the live chart should include the chart objects from your system.

Hopefully that explains it, let us know if it doesn't. Smile

Thanks,
Daniel



Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems