Hi all pro coders,
Im Phong & a newbie to MQL4. Im learning :)
The problem is that Im trying to code a simple horizontal line on mainwindow & It gets value from Input properties, when the tick comes the code will check if I move the line to new position & obtain new value. So when i change timframe the horizontal line will not be set as input value anymore, it should be kept at new value.
Could anyone show me the ideas to do that! or Functions to research/ codes ...???
Simple lines of code im trying...:/
I would be very grateful :)
Sharing is Caring!
if(ObjectFind(the line)<0) ObjectCreate(the line);
if(reason==REASON_REMOVE || reason==REASON_TEMPLATE) ObjectDelete(the line);
Great! Thanks a lot Kypa :))
have a good day!
Hey KyPa! how are you?
seems like I hit a brick wall! :/ Could you please help me!I notice that the global variable i declared (below is "lastalert") cant store data throughout the operating. Whenever I change chart timeframe, It is set as default again so I cant use the previous data that i stored in the variable "lastalert".Is there any way to store data throughtout operating & the data will not be reset as default untill removing the indicator???Here are the codes describing the problem:
extern bool Indicator_On = true;
extern double mlevel;
if ((Bid > mlevel) && (mlevel>0))
if ((TimeCurrent()-lastalert)>= 10*60 )// next alert at >= 10 min from the previous one.
lastalert = TimeCurrent();
Comment ("Last Alert at " + (string)lastalert + " -- Price is above the level "+(string)mlevel);
You can use this (the proper way):
Or some arrow object whose name is your variable (workaround) and is not deleted until expert remove (the code from last problem).
but it would probably be too much disk reads and writes.
I'm not sure of disk usage of GVCT, arrow workaround works mostly in ram.
if ((TimeCurrent()-lastalert)>= 10*60 )// next alert at >= 60 min from the previous one.
I got it! :)
Thanks a lot Whroder1,
I guess you/someone else will give me amazing tips on mql5 site :)
Thank you so much!
Have a good weekend!