I have buy, sell, short & cover values. I want to display it in the title along with green or red color, which would change based on the values being hit or not. Please help with coding this. I don't know if the code below is correct or not but it would give an idea of what am trying to achieve.
Title = Name()+" "+Date()+" MHA -- MO:"+NumToStr(MO,1.2,True)+" / MH:"+NumToStr(MH,1.2,True)+" / ML:"+NumToStr(ML,1.2,True)+" / MC:"+NumToStr(MC,1.2, True)+"
Buy:"+iif(H>Long,encodecolor(colorgreen),encodecolor(colorred))+numtostr(Long,1.2,True)+" Sell:"+ iif(L<Longstop,encodecolor(colorred),encodecolor(colorgreen))+numtostr(Longstop,1.2,True)+
" Short:"+IIf(L<Sllshrt,EncodeColor(colorRed),EncodeColor(colorGreen))+NumToStr(Sllshrt,1.2,True)+" Cover:"+IIf(H>Shortstop,EncodeColor(colorGreen),EncodeColor(colorRed))+NumToStr(Shortstop,1.2,True)+" Lg Tgt:"+NumToStr(Longtarget,1.2,True)+" Sh Tgt:"+NumToStr(Shorttarget,1.2,True);