Rank: Newbie
Groups: Registered Users, Subscribers Joined: 9/28/2015(UTC) Posts: 7
Thanks: 1 times
|
I want to plot
1. if(Today's A AND Today's B)>(previous days B)
2. if(Today's A AND Today's B)<(previous days B)
3. if(Today's A)>(previous days B) AND if(Today's B)<(previous days B)
Today's A,B and Previous Days B is the reference of INDICATOR_x's variable.
Only one condition will satisfy at a time.I Want to plot 1,2,3 when condition match.
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,953
Thanks: 91 times Was thanked: 155 time(s) in 150 post(s)
|
Hi,
I believe something like the below would accomplish what you are looking for.
A:=(Condition1);
B:=(Condition2);
If(A > Ref(B,-1) AND B > Ref(B,-1),1,If(A < Ref(B,-1) AND B < Ref(B,-1),2,If(A > Ref(B,-1) AND B < Ref(B,-1),3,0))) Edited by user Thursday, September 22, 2016 8:01:06 PM(UTC)
| Reason: Not specified
|
1 user thanked MS Support for this useful post.
|
|
|
Rank: Newbie
Groups: Registered Users, Subscribers Joined: 9/28/2015(UTC) Posts: 7
Thanks: 1 times
|
Thanks MS Support.
It works.
But my Condition A and Condition B are same(values) for all intraday. Above code is just giving one spike of 1,2,3 or 0. I want it to be constant for a day in intraday chart.
Thanks again.
|
|
|
|
Users browsing this topic |
|
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.