Calling MS formula experts

nitinsy

Active Member
#1
Hi,
I have been struggling with this for a while. Can you help?

EntryPrice:=If(<some expression>, Ref(EntryPrice, -1), HHV(H, 3));

I want to calculate entryprice based on some expression. If expression evaluates to false I would like to calculate a new value for entryprice. If expression is true I want to reuse the value of entryprice as of last bar

This indicator is not working in MS. What am I doing wrong?

Nitin
 
U

uasish

Guest
#2
Without the previous lines of the code it is not wise to try,still giving it a try;

If some expression is true then you are using ,Ref(EntryPrice, -1), here you have marked the variable as Entry Price again putting a condition which is referencing that very variable ;ref(EntryPrice,-1),yes we can do that but in some special cases.

You can break the variables:=
sm:= some expression;
EntryPrice:= if(sm=1,ref( o/h/l/c,-1),if(sm=-1/0,New value,0));{Here -1 or 0 is false & we are using the Nesting Function}
EntryPrice;

OR
sm:= some expression;
EntryPrice:= if(sm=1,ref( o/h/l/c,-1),PREV);{This function may address your referencing but will EAT into your RAM & will slow down the activity;i personally avoid this.}
EntryPrice;
 
#3
Hello all,

i am working on trends,
A trend is up if its ema of current period is greater then the ema of the last period and vice versa.

Now suppose i have defined Bull:=(MOV(C,3,E);

now what i want is that it calculates the previous period value of the bull and and if the privious period value is less then the current period value then the trend is up and vice versa.

What i want is to work with loop or if there is any other way pls guide me.
thanks in advance


PS : I know it can work like this MOV(C,3,E)>MOV(MOV(C,3,E),3,E) but i want it to be used with the bull function.
 
D

darsh_goswami

Guest
#4
Hello all,

i am working on trends,
A trend is up if its ema of current period is greater then the ema of the last period and vice versa.

Now suppose i have defined Bull:=(MOV(C,3,E);

now what i want is that it calculates the previous period value of the bull and and if the privious period value is less then the current period value then the trend is up and vice versa.

What i want is to work with loop or if there is any other way pls guide me.
thanks in advance


PS : I know it can work like this MOV(C,3,E)>MOV(MOV(C,3,E),3,E) but i want it to be used with the bull function.
you have been answered Vivek ,.. check other thread .
 

Similar threads