
07-31-2008, 06:53 PM
|
 |
Senior Member
|
|
Join Date: Oct 2006
Posts: 1,174
|
|
Quote:
Originally Posted by cja
Hi ANCOLL
Good to hear from you again, I have just got back from the Christmas holidays and am ready to get back into it. I use this code I hope you find it works for you.
string Message="";
datetime expire = D'2008.02.04 12:00';
if (TimeCurrent()>expire){
Alert("Trial has ended. Please contact xxxx @ xxxx.com");
return(0);
}else {Message="Price Display Activated";}
ObjectDelete("Price_Account_Info");
ObjectCreate("Price_Account_Info", OBJ_LABEL,WindowFind("Price"), 0, 0);
ObjectSetText("Price_Account_Info",""+Message+" - Expires "+TimeToStr(expire)+"",8, "Tahoma", ForestGreen);
ObjectSet("Price_Account_Info", OBJPROP_CORNER, 3);
ObjectSet("Price_Account_Info", OBJPROP_XDISTANCE, 5);
ObjectSet("Price_Account_Info", OBJPROP_YDISTANCE, 5);
This code puts a message into the indicator window or chart window and an expiry into an Alert Box
Attachment 51899
This example puts a message into the indicator window or chart window and an expiry into the top left of the chart
datetime expire = D'2008.02.04 13:25';
if (TimeCurrent()>expire){
Comment("Trial has ended. Please contact xxxx @ xxxx.com");
return(0);
}else {Message="Price Display Activated";}
ObjectDelete("Price_Account_Info");
ObjectCreate("Price_Account_Info", OBJ_LABEL,WindowFind("Price"), 0, 0);
ObjectSetText("Price_Account_Info",""+Message+" - Expires "+TimeToStr(expire)+"",8, "Tahoma", ForestGreen);
ObjectSet("Price_Account_Info", OBJPROP_CORNER, 3);
ObjectSet("Price_Account_Info", OBJPROP_XDISTANCE, 5);
ObjectSet("Price_Account_Info", OBJPROP_YDISTANCE, 5);
Attachment 51900
This next example puts both the messages into Comments on the top left of the chart.
datetime expire = D'2008.02.04 13:25';
if (TimeCurrent()>expire){
Comment("Trial has ended. Please contact xxxx @ xxxx.com");
return(0);
}else {Comment("Price Display Activated");}
All of these codes make the indicator disappear when the expiry time is up
A simple indicator as an example posted below
Attachment 51902
cja
|
Updated below
Last edited by matrixebiz; 08-02-2008 at 11:54 PM.
|