problem with Signal based on 2 data

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
maxme
Posts: 34
Joined: 16 Aug 2006

problem with Signal based on 2 data

Postby maxme » 12 Mar 2009

Hi
I have a chart with Data1 x 1Min and Data2 x 2Min .
I plot a signal with entry and sell based also on the Data2 ; I plot also an indicator based on data2 ( this indicator ( based on Close of data2 ) is also included in the signal and i need for entries and sells from it ; when the the indicator based on Data2 crosses above or below its average I must have in the signal the corresponding entries or exits ... ;
but the entry and sell generates from the signal does not match with the indicator himself ...... !
The entries and exits are generated but they correspond to the same indicator but as it was based on data1 not on Data2 ...... ! Why ?
any help ?
best regards
Maxme

User avatar
TJ
Posts: 6551
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 966 times
Been thanked: 1892 times

Postby TJ » 12 Mar 2009

you can use Data2 for analysis and trigger,
but autotrade can only apply to Data1.

maxme
Posts: 34
Joined: 16 Aug 2006

Postby maxme » 16 Mar 2009

Hi
thanks for reply .
I use data2 in a Signal NOT for Autotrade , but as a trigger from some inputs based on Data2 , to confirm some entries and exits based on data1.
But the triggers that comes from the inputs on Data2 are not respected from the signal ......
thanks for help
best regards
Maxme

User avatar
TJ
Posts: 6551
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 966 times
Been thanked: 1892 times

Postby TJ » 16 Mar 2009

if your data2 is of a different time frame, there might be a timing difference.

you can try to use intrabarpersist on the variables.

add this to your code, you can check the read out in the PowerLanguage Editor.


print("var1=", var1, "; var2=", var2);

maxme
Posts: 34
Joined: 16 Aug 2006

signal on 2 data

Postby maxme » 20 Mar 2009

Hello TJ
thanks for reply !
the signal has inputs based also on Data2 ; per example " if average( close of data2 ,9) > average( close of data2 ,9)[1] and H > H[1] then buy ........ " .
the problem is that this inputs seems to be not respected ( per example the average is down and I have a Buy from the signal ... ) , why ?
You write me to use " intrabarpersist " , what is this ?
How I must use the code You wrote me to read the output ?
thanks
Maxme

User avatar
TJ
Posts: 6551
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 966 times
Been thanked: 1892 times

Postby TJ » 20 Mar 2009

there is a PowerLanguage Dictionary.

look inside your MultiCharts program files directory.

look for a file call powerlanguage.cfm (Compiled HTML Help File)



alternatively you can go to the PowerEditor,

select View> Navigator Bar


explanation to all the keywords and functions are there.


Return to “User Contributed Studies and Indicator Library”