Drawing or ploting from strategy  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
Drogo
Posts: 14
Joined: 11 Oct 2012
Has thanked: 2 times

Drawing or ploting from strategy

Postby Drogo » 24 Apr 2015

Hello,

I would like to draw some point or text to the chart from strategy to check my calculation in code in certain time.
Now I use output window to see required information, but to see them in chart would be more better.

Is there any way how to do it?

Thanks in advance for help.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Drawing or ploting from strategy

Postby Henry MultiСharts » 24 Apr 2015

Hello Drogo,

Please refer to the wiki section to learn how to place drawings: 4.3_Plotting_on_the_Chart#Drawings

Drogo
Posts: 14
Joined: 11 Oct 2012
Has thanked: 2 times

Re: Drawing or ploting from strategy

Postby Drogo » 24 Apr 2015

Hello Henry,

I saw the article, but I cannot use plotting in the same way as in the indicator.. (namespace)
Maybe I do not understand the article, could you correct me this strategy?
There is an Example strategy of plotting:

using System;
using System.Drawing;
using PowerLanguage.Function;
using ATCenterProxy.interop;
using PowerLanguage.Strategy;
using PowerLanguage.Indicator;

namespace PowerLanguage.Strategy {
public class ExampleStrategy : SignalObject {
public ExampleStrategy(object _ctx):base(_ctx){
Output.Clear();

}
private IOrderMarket buy_order;
private IPlotObject plot1;
protected override void Create() {

buy_order = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Buy));

plot1 = AddPlot(new PlotAttributes("Sample", EPlotShapes.Line, Color.Red));
// there is error The name 'AddPlot' does not exist in the current context


}
protected override void StartCalc() {

}
protected override void CalcBar(){


plot1.Set(0,Bars.Low);
}


}

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Drawing or ploting from strategy  [SOLVED]

Postby Henry MultiСharts » 24 Apr 2015

Drogo,

Plots can be done by an indicator only. Drawings can be placed by both indicator and signal.


Return to “MultiCharts .NET”