What's wrong with this parabolic data1 and data2 ?  [SOLVED]

Questions about MultiCharts and user contributed studies.
Automeq
Posts: 108
Joined: 16 Apr 2014
Has thanked: 15 times
Been thanked: 1 time

What's wrong with this parabolic data1 and data2 ?

Postby Automeq » 28 Nov 2017

I have a chart where I plotted same instrument with different time frames

data1 = 5 minutes
data2 = 30 minutes

Then I created following indicator. Ideia is to plot parabolic of 30 minutes (data2) in the 5 minutes chart (data1) - I know that could be done directly but this is something I'm testing to use in a signal.

Code: Select all

inputs: AfStep1( 0.001 ), AfLimit1( 0.2 ), // parameters for data1 (5 minutes)
AfStep2( 0.005 ), AfLimit2( 0.2 ); // parameters for data2 (30 minutes)

variables: var0(0),var1(0),var2(0),var3(0), // parameters for data1 (5 minutes)
var4(0),var5(0),var6(0),var7(0); // parameters for data2 (30 minutes)


Value1 = ParabolicSAR( AfStep1, AfLimit1, var0, var1, var2, var3 ) of data1;

Value2 = ParabolicSAR( AfStep2, AfLimit2, var4, var5, var6, var7 ) of data2;


plot1(var4)
If I plot this indicator in data1 (5 minutes) shouldn't I get the parabolic(0.005,0.2) of 30 minutes plotted in 5 minutes chat ?

I'm getting values that I don't understand where they are coming from.

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

Re: What's wrong with this parabolic data1 and data2 ?  [SOLVED]

Postby TJ » 28 Nov 2017

I have a chart where I plotted same instrument with different time frames

data1 = 5 minutes
data2 = 30 minutes

Then I created following indicator. Ideia is to plot parabolic of 30 minutes (data2) in the 5 minutes chart (data1) - I know that could be done directly but this is something I'm testing to use in a signal.

Code: Select all

inputs: AfStep1( 0.001 ), AfLimit1( 0.2 ), // parameters for data1 (5 minutes)
AfStep2( 0.005 ), AfLimit2( 0.2 ); // parameters for data2 (30 minutes)

variables: var0(0),var1(0),var2(0),var3(0), // parameters for data1 (5 minutes)
var4(0),var5(0),var6(0),var7(0); // parameters for data2 (30 minutes)


Value1 = ParabolicSAR( AfStep1, AfLimit1, var0, var1, var2, var3 ) of data1;

Value2 = ParabolicSAR( AfStep2, AfLimit2, var4, var5, var6, var7 ) of data2;


plot1(var4)
If I plot this indicator in data1 (5 minutes) shouldn't I get the parabolic(0.005,0.2) of 30 minutes plotted in 5 minutes chat ?

I'm getting values that I don't understand where they are coming from.


See post #5
viewtopic.php?f=16&t=6929

Automeq
Posts: 108
Joined: 16 Apr 2014
Has thanked: 15 times
Been thanked: 1 time

Re: What's wrong with this parabolic data1 and data2 ?

Postby Automeq » 28 Nov 2017

Thank you very much TJ !

I leave here the simplified code for the case someone, someday, drops in this post.

Code: Select all

inputs: AfStep2( 0.005 ), AfLimit2( 0.2 ); // parameters for parabolic of data2

variables: var4(0,data2),var5(0,data2),var6(0,data2),var7(0,data2); // parameters for parabolic of data2


Value2 = ParabolicSAR( AfStep2, AfLimit2, var4, var5, var6, var7 )data2;


plot1(var4)
And btw that post you mentioned is a true gem ! Really appreciated.


Return to “MultiCharts”