Tradeline problem, need help..

Questions about MultiCharts .NET and user contributed studies.
Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

Tradeline problem, need help..

Postby Ram » 15 Feb 2015

Hi,

I'm using trade lines to draw lines in the future (in this case 26 bars ahead of last bar):
Image

When in Playback mode, once I get to end of session the drawing skips few bars:
Image

If I recalculate the indicator at the above step:
Image

Then it redraw it as it should have:
Image

This is the code I've used for this example on a 1 minute chart:

Code: Select all

Imports System
Imports System.Drawing
Imports PowerLanguage
Imports PowerLanguage.Indicator
Imports PowerLanguage.Function
Imports System.Linq

Namespace PowerLanguage.Indicator
Public Class Henry_Trendline_EndOfDay
Inherits IndicatorObject

Public Sub New(ByVal _ctx As Object)
MyBase.New(_ctx)
End Sub

Private TrendLine As VariableObject(Of ITrendLineObject)

Protected Overrides Sub CalcBar()
Dim MyBar As Integer = Bars.CurrentBarAbsolute + 26
TrendLine.Value = DrwTrendLine.Create(New ChartPoint(Bars.Time.Item(0), 0), New ChartPoint(Bars.Time.Item(0), 0))
TrendLine.Value.End = New ChartPoint(MyBar, Bars.Close(0)+10)
TrendLine.Value.Begin = New ChartPoint(MyBar, Bars.Close(0))
TrendLine.Value.Size = 1
TrendLine.Value.Style = 2
End Sub

Protected Overrides Sub Create()
TrendLine = New VariableObject(Of ITrendLineObject)(Me)
End Sub

Protected Overrides Sub StartCalc()
End Sub

End Class
End Namespace
Thank you in advance,
Best,
R.

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

Re: Tradeline problem, need help..

Postby Henry MultiСharts » 17 Feb 2015

Hello Ram,

We were unable to replicate this behavior using MultiCharts .NET64 Version 9.0 Release (Build 10717). Please update to the latest Release build and let us know in case the issue persists.


Return to “MultiCharts .NET”