logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
indexarb  
#1 Posted : Monday, March 12, 2012 11:21:13 AM(UTC)
indexarb

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/12/2012(UTC)
Posts: 44

Hi I have 2 indicators for the same security 1 min and 5 min time frames The indicators output a -1 for short 0 for flat 1 for long is there anyway to have a formula that says if the 1 min indicator is 1 and the 5 min is 1 then the combined indicator is 1, if the 1 min is -1 and the 5 min is -1 then the combined indicator is -1, else the combined indicator is 0 what chart would be shown on if it can be done? thanks mehul
henry1224  
#2 Posted : Monday, March 12, 2012 11:47:06 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)

Without seeing any code? or hint's of what you are using for indicators !for starters, if your indicators are applied to the same chart, the 5 min indicator will be dynamic until the completion of it's time frame calculation.

you will need to use 2 if statements
Code:
 .
Con:=If(1min=1 and 5min=1,1,If(1min=-1 and 5Min=-1,-1,0));
Con;
 

indexarb  
#3 Posted : Monday, March 12, 2012 12:28:28 PM(UTC)
indexarb

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/12/2012(UTC)
Posts: 44

Can you apply a 5 min indicator to a 1 min chart? also would this be a new indicator that looks at the 1 and 5 min indicators? i am using an external piece of software and do not have access to the code just the indicators here is the formula for the 1 and 5 min, so how would i use this as a combined indicator? 1 min if((Sum(Mov(C-Ref(C,-1),12,S),5)-Ref(Sum(Mov(C-Ref(C,-1),12,S),5),-1)>0) And (Sum(Mov(C-Ref(C,-1),8,S),8)-Ref(Sum(Mov(C-Ref(C,-1),8,S),8),-1)>0) And (Sum(Mov(C-Ref(C,-1),9,S),7)-Ref(Sum(Mov(C-Ref(C,-1),9,S),7),-1)>0) And (Sum(Mov(C-Ref(C,-1),7,S),4)-Ref(Sum(Mov(C-Ref(C,-1),7,S),4),-1)>0) And ((Mov(C-Ref(C,-1),5,S)>(-1)*Mov(C-Ref(C,-1),6,S)) And (Mov(C-Ref(C,-1),6,S)>(-1)*Mov(C-Ref(C,-1),3,S))) And ((Mov(C-Ref(C,-1),6,S)>(-1)*Mov(C-Ref(C,-1),10,S)) And (Mov(C-Ref(C,-1),6,S)>(-1)*Mov(C-Ref(C,-1),5,S))) ,1,if((Sum(Mov(C-Ref(C,-1),12,S),8)-Ref(Sum(Mov(C-Ref(C,-1),12,S),8),-1)<0) And (Sum(Mov(C-Ref(C,-1),11,S),11)-Ref(Sum(Mov(C-Ref(C,-1),11,S),11),-1)<0) And (Sum(Mov(C-Ref(C,-1),12,S),7)-Ref(Sum(Mov(C-Ref(C,-1),12,S),7),-1)<0) And (Sum(Mov(C-Ref(C,-1),7,S),6)-Ref(Sum(Mov(C-Ref(C,-1),7,S),6),-1)<0) And ((Mov(C-Ref(C,-1),11,S)<(-1)*Mov(C-Ref(C,-1),12,S)) And (Mov(C-Ref(C,-1),3,S)<(-1)*Mov(C-Ref(C,-1),4,S))) And ((Mov(C-Ref(C,-1),11,S)<(-1)*Mov(C-Ref(C,-1),10,S)) And (Mov(C-Ref(C,-1),12,S)<(-1)*Mov(C-Ref(C,-1),3,S))), -1, 0)) {SUM_RANGE=3-12, MOV_RANGE=3-12} 5 min if((Sum(Mov(C-O,7,S),9)-Ref(Sum(Mov(C-O,7,S),9),-1)>0) And (Sum(Mov(C-O,11,S),3)-Ref(Sum(Mov(C-O,11,S),3),-1)>0) And (Sum(Mov(C-O,8,S),3)-Ref(Sum(Mov(C-O,8,S),3),-1)>0) And (Sum(Mov(C-O,5,S),7)-Ref(Sum(Mov(C-O,5,S),7),-1)>0) And ((Mov(C-O,7,S)>(-1)*Mov(C-O,6,S)) And (Mov(C-O,6,S)>(-1)*Mov(C-O,12,S))) And ((Mov(C-O,5,S)>(-1)*Mov(C-O,3,S)) And (Mov(C-O,11,S)>(-1)*Mov(C-O,6,S))) ,1,if((Sum(Mov(C-O,8,S),8)-Ref(Sum(Mov(C-O,8,S),8),-1)<0) And (Sum(Mov(C-O,3,S),3)-Ref(Sum(Mov(C-O,3,S),3),-1)<0) And (Sum(Mov(C-O,5,S),7)-Ref(Sum(Mov(C-O,5,S),7),-1)<0) And (Sum(Mov(C-O,3,S),9)-Ref(Sum(Mov(C-O,3,S),9),-1)<0) And ((Mov(C-O,12,S)<(-1)*Mov(C-O,12,S)) And (Mov(C-O,5,S)<(-1)*Mov(C-O,4,S))) And ((Mov(C-O,7,S)<(-1)*Mov(C-O,10,S)) And (Mov(C-O,8,S)<(-1)*Mov(C-O,11,S))), -1, 0)) {SUM_RANGE=3-12, MOV_RANGE=3-12} thanks in advance ....
wabbit  
#4 Posted : Monday, March 12, 2012 5:26:02 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
STOP DOUBLE POSTING!

wabbit [:D]

henry1224  
#5 Posted : Monday, March 12, 2012 5:41:37 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
Code:

1 min



if((Sum(Mov(C-Ref(C,-1),12,S),5)-Ref(Sum(Mov(C-Ref(C,-1),12,S),5),-1)>0)
 And 
(Sum(Mov(C-Ref(C,-1),8,S),8)-Ref(Sum(Mov(C-Ref(C,-1),8,S),8),-1)>0) 
And 
(Sum(Mov(C-Ref(C,-1),9,S),7)-Ref(Sum(Mov(C-Ref(C,-1),9,S),7),-1)>0) 
And 
(Sum(Mov(C-Ref(C,-1),7,S),4)-Ref(Sum(Mov(C-Ref(C,-1),7,S),4),-1)>0) 
And ((Mov(C-Ref(C,-1),5,S)>(-1)*Mov(C-Ref(C,-1),6,S)) And 
(Mov(C-Ref(C,-1),6,S)>(-1)*Mov(C-Ref(C,-1),3,S))) And 
((Mov(C-Ref(C,-1),6,S)>(-1)*Mov(C-Ref(C,-1),10,S)) And 
(Mov(C-Ref(C,-1),6,S)>(-1)*Mov(C-Ref(C,-1),5,S)))

,1,if((Sum(Mov(C-Ref(C,-1),12,S),8)-Ref(Sum(Mov(C-Ref(C,-1),12,S),8),-1){SUM_RANGE=3-12, MOV_RANGE=3-12}





5 min



if((Sum(Mov(C-O,7,S),9)-Ref(Sum(Mov(C-O,7,S),9),-1)>0) And 
(Sum(Mov(C-O,11,S),3)-Ref(Sum(Mov(C-O,11,S),3),-1)>0) And 
(Sum(Mov(C-O,8,S),3)-Ref(Sum(Mov(C-O,8,S),3),-1)>0) And 
(Sum(Mov(C-O,5,S),7)-Ref(Sum(Mov(C-O,5,S),7),-1)>0) And 
((Mov(C-O,7,S)>(-1)*Mov(C-O,6,S)) And 
(Mov(C-O,6,S)>(-1)*Mov(C-O,12,S))) And 
((Mov(C-O,5,S)>(-1)*Mov(C-O,3,S)) And 
(Mov(C-O,11,S)>(-1)*Mov(C-O,6,S)))

,1,if((Sum(Mov(C-O,8,S),8)-Ref(Sum(Mov(C-O,8,S),8),-1){SUM_RANGE=3-12, MOV_RANGE=3-12}





Your 5 min indicator is not a true 5 minute time frame indicator!

What are you doing? applying the 1 Min indicator on a 1 min chart
and applying the 5 Min indicator onto a 5 min chart?

What are you looking for a comparison of Multi time frame analysis of the same indicator
or analysis of the 1 min indicator from a 1 min chart and the 5 min indicator from a 5 min chart?
wabbit  
#6 Posted : Monday, March 12, 2012 6:13:21 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
The code is incomplete: there are conditions missing from the If() evaluations.


wabbit [:D]

wabbit  
#7 Posted : Monday, March 12, 2012 6:55:22 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
As Henry has already pointed out, there is nothing in those codes which makes it specifically any time period -- you could apply either of those indicators to any timeframe chart.

I guess what you are looking to do is to take the values from one indicator plotted on a 1M chart and the values from the other indicator plotted on the 5M chart and do some comparison operation? If this is the case, then you'll need to rewrite the longer timeframe indicator in such a way that it can be plotted on the smaller timeframe chart alongside the small timeframe indicator.

In the meantime, I have taken some time to recover the "true" codes to discover they must be contenders for some of the worst code of the year! I rewrote them to be be faster to execute and easier to manage. Please work through every line of code to understand how to write better code; and also see if you understand the logic because it doesn't make a lot of sense to me (in fact I have seen this sort of thing before -- someone jams together a whole pile of conditions and then calls it "technical analysis").

Code:

{plot on 1M chart}
data:=C-Ref(C,-1);

up:=
ROC(Sum(Mov(data,12,S),5),1,$)>0 AND
ROC(Sum(Mov(data,8,S),8),1,$)>0 AND
ROC(Sum(Mov(data,9,S),7),1,$)>0 AND
ROC(Sum(Mov(data,7,S),4),1,$)>0 AND
Mov(data,5,S)>(-Mov(data,6,S)) AND
Mov(data,6,S)>(-Mov(data,3,S)) AND
Mov(data,6,S)>(-Mov(data,10,S)) AND
Mov(data,6,S)>(-Mov(data,5,S));

dn:=
ROC(Sum(Mov(data,12,S),8),1,$)<0 AND
ROC(Sum(Mov(data,11,S),11),1,$)<0 AND
ROC(Sum(Mov(data,12,S),7),1,$)<0 AND
ROC(Sum(Mov(data,7,S),6),1,$)<0 AND
Mov(data,11,S)<(-Mov(data,12,S)) AND
Mov(data,3,S)<(-Mov(data,4,S)) AND
Mov(data,11,S)<(-Mov(data,10,S)) AND
Mov(data,12,S)<(-Mov(data,3,S));

up-dn;


Code:

{plot on 5M chart}
data:=C-O;

up:=
ROC(Sum(Mov(data,7,S),9),1,$)>0 AND
ROC(Sum(Mov(data,11,S),3),1,$)>0 AND
ROC(Sum(Mov(data,8,S),3),1,$)>0 AND
ROC(Sum(Mov(data,5,S),7),1,$)>0 AND
Mov(data,7,S)>(-Mov(data,6,S)) AND
Mov(data,6,S)>(-Mov(data,12,S)) AND
Mov(data,5,S)>(-Mov(data,3,S)) AND
Mov(data,11,S)>(-Mov(data,6,S));

dn:=
ROC(Sum(Mov(data,8,S),8),1,$)<0 AND
ROC(Sum(Mov(data,3,S),3),1,$)<0 AND
ROC(Sum(Mov(data,5,S),7),1,$)<0 AND
ROC(Sum(Mov(data,3,S),9),1,$)<0 AND
Mov(data,12,S)<(-Mov(data,12,S)) AND {WTF?}
Mov(data,5,S)<(-Mov(data,4,S)) AND
Mov(data,7,S)<(-Mov(data,10,S)) AND
Mov(data,8,S)<(-Mov(data,11,S));

{plot}
up-dn;



Please also note that codes post "properly" (most of the time) when places between the proper tags!


wabbit [:D]


[Edit]
P.S. You could do the analysis required and change some of the Sum(Mov()) functions into simpler triangular moving averages.
indexarb  
#8 Posted : Tuesday, March 13, 2012 3:56:22 PM(UTC)
indexarb

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/12/2012(UTC)
Posts: 44

Thank you ... Will play around
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.