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: 37
Joined: 16 Aug 2006
Has thanked: 2 times

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: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Postby TJ » 12 Mar 2009

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

maxme
Posts: 37
Joined: 16 Aug 2006
Has thanked: 2 times

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: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 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: 37
Joined: 16 Aug 2006
Has thanked: 2 times

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: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 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”