Hello i need help with Writeif Function which i am using as below:
StartCond=DateNum()!=Ref(DateNum(),-1); //Day Start
StartPoint=BarsSince(StartCond); //Barssince Day Start
PdayEndPoint=StartPoint+1; //Previous Day Close Bar
Obar_Close=Ref(Close,-StartPoint); // Close Price of Opening Bar
PdayObar_Close=Ref(Obar_Close,-PdayEndPoint); // Close Price of Previous Day Opening Bar
Pday_Trend=Pday_Close>PdayObar_Close; // Check if current day Close of Opening Bar > Pday Close
// in Exploration: show Up if "Previous day close">close of Previous day "Open Bar Close"
AddTextColumn(WriteIf(Pday_Trend,"UP","DOWN"),"YDAY TREND");
I am getting wrong output in Writeif even though the condition is correct as shown by values below
![image|690x384](upload://glgTly7bCe8jto7FF9wm6zKje7S.png)