closed(1) of data2 does not work, STD error

Questions about MultiCharts and user contributed studies.
radekj
Posts: 113
Joined: 28 Apr 2008
Has thanked: 20 times
Been thanked: 1 time

closed(1) of data2 does not work, STD error

Postby radekj » 18 May 2009

Hallo,

closed(1) of data2 is generating STD error,

can somebody test it, maybe it is only problem of my data ?!

ciao
radekj

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 18 May 2009

can you copy and paste the whole error message?
or a screen shot?


do you mean

close(1) of data2

instead of

closed(1) of data2

radekj
Posts: 113
Joined: 28 Apr 2008
Has thanked: 20 times
Been thanked: 1 time

Postby radekj » 18 May 2009

I mean:

closed(1) of data2;

obtain close price of previous day of data stream number 2 on intraday basis;

or KISS: so you get (normaly) close price of yesterday of second data on you chart.

Full error text:
"Message: Error in study "My Test":STD exception : invalid argument"

ciao
radekj

radekj
Posts: 113
Joined: 28 Apr 2008
Has thanked: 20 times
Been thanked: 1 time

Postby radekj » 18 May 2009

DEfinition of closed:

CloseD (Series Function)

The CloseD function allows you to reference the daily Close of previous days in an intraday chart (minute or tick-based) or a daily chart.

CloseD is a function in a family of functions that allows historical daily, weekly, monthly, and yearly references in intraday charts. See also: HighD, LowD, OpenD, CloseW, CloseM, and CloseY.

Usage
CloseD(PeriodsAgo)

Returns (Double)
A numeric value for the current bar. If the PeriodsAgo parameter is out of range (> 50), or there is not enough data, the function will return –1.

Parameters
PeriodsAgo
A numeric value. The number of days/periods back to reference a previous day’s closing price. (50 days back maximum) (0 = Today’s current Close)


Remarks
You must have enough intraday data in the chart in order to look back and reference any previous close. For example, if you want to look back at the close of 25 days ago on a 5-minute chart, you must have 25 days of 5-minute bars in the chart.

The value for the PeriodsAgo input parameter should always be a positive whole number greater than or equal to 0, but less than 51. Setting PeriodsAgo to 0 equals today’s current Close.

Example
Assigns the Close of the previous day on an intraday chart to Value1, then plots Value1:

Value1 = CloseD(1);

Plot1(Value1, "PrevClose");

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 18 May 2009

it works in my MC.

Version 5.0 Beta 5 (Build 2199)
Last edited by TJ on 18 May 2009, edited 2 times in total.

radekj
Posts: 113
Joined: 28 Apr 2008
Has thanked: 20 times
Been thanked: 1 time

Postby radekj » 18 May 2009

Many THX,

it must be a problem with my data.

ciao
radekj


Return to “MultiCharts”