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

Notification

Icon
Error

Options
Go to last post Go to first unread
vinayak  
#1 Posted : Thursday, September 22, 2016 10:32:23 AM(UTC)
vinayak

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.
MS Support  
#2 Posted : Thursday, September 22, 2016 7:59:51 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,929

Thanks: 85 times
Was thanked: 154 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

thanks 1 user thanked MS Support for this useful post.
vinayak on 9/23/2016(UTC)
vinayak  
#3 Posted : Friday, September 23, 2016 11:12:43 AM(UTC)
vinayak

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.