CloseD function not working on 1 Tick chart?

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

CloseD function not working on 1 Tick chart?

Postby lewisthegood » 04 Aug 2021

I have applied CloseD function and would like get the close of the previous day. I found that the result always return "-1" which is obviously wrong.

May I ask if the CloseD function is not working on 1 Tick chart? and the reason why (programmatically)

Code:

CloseD previous_close;

Create()
{ previous_close; = new CloseD(this);
....}

StartCal()
{previous_close.periodsago = 1;
...}

Calbar()
{ previous_close[1];
...

User avatar
Tammy MultiCharts
Posts: 200
Joined: 06 Aug 2020
Has thanked: 6 times
Been thanked: 65 times

Re: CloseD function not working on 1 Tick chart?

Postby Tammy MultiCharts » 04 Aug 2021

Hello lewisthegood,

We checked it on our end and found out that OHLCPeriodsAgo function is not working as expected.
Our engineers will fix it in one of the nearest releases.

In the meantime please replace the function with the attached script.
Attachments
OHLCPeriodsAgo_Modify.pln
(2.42 KiB) Downloaded 101 times


Return to “MultiCharts .NET”