CloseD gives the close of the first bar on trade date instead of previous close

Questions about MultiCharts .NET and user contributed studies.
lewisthegood
Posts: 21
Joined: 08 Mar 2021
Been thanked: 1 time

CloseD gives the close of the first bar on trade date instead of previous close

Postby lewisthegood » 03 May 2021

I’m trading with Futures which closed at 23:00, I found that CloseD gives the close of the first bar on trade date instead of previous close. Here’s my coding:
...
Private CloseD ytd_close
...
Create()
{
...
ytd_close = new CloseD
}

StartCal()
{
....
ytd_close.periodago = 1
}

Calbar()
{
....
Value1 = ytd_close[1]
}

Please advise the correcting coding...

User avatar
Kate MultiCharts
Posts: 575
Joined: 21 Oct 2020
Has thanked: 7 times
Been thanked: 144 times

Re: CloseD gives the close of the first bar on trade date instead of previous close

Postby Kate MultiCharts » 13 May 2021

Hello lewisthegood,

Please refer to the TestHL.pln indicator script.

It can be found in this discussion.


Return to “MultiCharts .NET”