Help Needed with using functions in indicators

Questions about MultiCharts and user contributed studies.
bauhinia
Posts: 31
Joined: 08 Sep 2011
Has thanked: 4 times
Been thanked: 2 times

Help Needed with using functions in indicators

Postby bauhinia » 21 Sep 2011

Hi All,

I have a function that I have created and wish to use it in an indicator and have it returns 0; Any help would be appreciated:

Code: Select all

inputs: N(NumericSimple),PriceA(NumericSeries),PriceB(NumericSeries);
vars:
 ATR_B(0);

ATR_B = XAverage(PriceA-PriceB,N);



Indicator:

Code: Select all

inputs: N(100),PriceA(High),PriceB(Low);
vars:
 ATR_B(0);

ATR_B = _Fnc_ATR_B(PriceA,PriceB,N);

Plot1 (ATR_B, "ATR_b");


Many thanks

User avatar
Henry MultiСharts
Posts: 8479
Joined: 25 Aug 2011
Has thanked: 1211 times
Been thanked: 2720 times

Re: Help Needed with using functions in indicators

Postby Henry MultiСharts » 21 Sep 2011

Hello Bauhinia.
Please try this code for function:

Code: Select all

inputs: N(NumericSimple),PriceA(NumericSeries),PriceB(NumericSeries);
ATR_B = XAverage(PriceA-PriceB,N);


This one for signal:

Code: Select all

inputs: N(100),PriceA(High),PriceB(Low);
vars:
ATR_Ba(0);

ATR_Ba = ATR_B(PriceA,PriceB,N);

Plot1 (ATR_Ba, "ATR_b");
These users thanked the author Henry MultiСharts for the post (total 2):
bauhiniaJoshM

bauhinia
Posts: 31
Joined: 08 Sep 2011
Has thanked: 4 times
Been thanked: 2 times

Re: Help Needed with using functions in indicators

Postby bauhinia » 22 Sep 2011

thanks i have got it working
appreciate your help


Return to “MultiCharts”