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.
Drawing or ploting from strategy [SOLVED]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Drawing or ploting from strategy
Hello Drogo,
Please refer to the wiki section to learn how to place drawings: 4.3_Plotting_on_the_Chart#Drawings
Please refer to the wiki section to learn how to place drawings: 4.3_Plotting_on_the_Chart#Drawings
Re: Drawing or ploting from strategy
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);
}
}
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);
}
}
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Drawing or ploting from strategy [SOLVED]
Drogo,
Plots can be done by an indicator only. Drawings can be placed by both indicator and signal.
Plots can be done by an indicator only. Drawings can be placed by both indicator and signal.