Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am new in this forum, hope to contribute and learn here from you all.
I am dealing with plotting a text on the chart at a fixed position (i.e. upper left corner), based on date/time/price visible on the chart. I am using getappinfo, with aiLeftDispDateTime and aiHighestDispValue, but only the last one works with text_new and set_textlocation. Basically I cant understand how to pass date&time info to text_new separatly as date and time.
if symbol = "GS:EUR A0-FX" and (time_1<>time_1[1] or price_1<>price_1[1]) then
print(
symbol,
"data-> ",
StringToDate(DateTimeToString(getappinfo(aiLeftDispDateTime))),
"string data->",
datetostring(StringToDate(DateTimeToString(getappinfo(aiLeftDispDateTime)))),
"ora-> ",
StringTotime(DateTimeToString(getappinfo(aiLeftDispDateTime)))," ",
"string time->",
timetostring(StringTotime(DateTimeToString(getappinfo(aiLeftDispDateTime)))), " ",
getappinfo(aiHighestDispValue):0:4,
setup_count_buy," ",
setup_count_sell,
" ",
getappinfo(aiLeftDispDateTime)
);
if date_1<>date_1[1] or time_1>time_1[1] or price_1<>price_1[1] then
begin
id_3=text_new(
date_1,
time_1,
price_1,
"test test test test"
);
value2=text_setlocation(id_3, date_1, time_1, price_1);
end;
I have inserted both the text_new command and the print command, to check the variables values.
What I can understand is that the print command correctly gets the date/time values of the DISPLAYED series, while the text_new command seems to disregard and continue to plot on the first bar of the entire series, even if not visible.
I have also tried to convert the date&time resulting from the getappinfo to string and then back to values separating date and time (exactly as in the print command) but this make no difference:
(where the DateTime numeric value is split in a time with 'HHmm' format (so 0815 for fifteen minutes pas eight in the morning), and date in 'ddMMyy' format (so 261011 for October 26th 2011)).
no, I have tried, but this values cannot be entered in the text_new function, it is expecting easylanguage format of date and time... looking at my print results, it should be accomplished by
Actually in your example your are passing the formatted values to the string, while text_new gets the normal Date input (I dont know how time_s is defined, but again it is not the formatted time that you use to compose the text).
Am I wrong?
Actually in your example your are passing the formatted values to the string, while text_new gets the normal Date input (I dont know how time_s is defined, but again it is not the formatted time that you use to compose the text).
Am I wrong?
So, you want to use the aiLeftDispDateTime and aiRightDispDateTime to plot the text, using them as coordinates for that? In that case, my apologies, then I mistakenly assumed that you wanted to convert them to strings, and use them in the plotted text.
Try this to use aiLeftDispDateTime and aiRightDispDateTime to use as "coordinates" for the placement of Text_New_s:
If this is also not what you mean, please be extremely clear and brief on what you want to achieve, because in that case I don't follow what you want to do.
So, you want to use the aiLeftDispDateTime and aiRightDispDateTime to plot the text, using them as coordinates for that? In that case, my apologies, then I mistakenly assumed that you wanted to convert them to strings, and use them in the plotted text.
Try this to use aiLeftDispDateTime and aiRightDispDateTime to use as "coordinates" for the placement of Text_New_s:
If this is also not what you mean, please be extremely clear and brief on what you want to achieve, because in that case I don't follow what you want to do.
Thanks for your patience Jura!
it is exactly what I want to do.
the date now is working perfectly, thank you.
Only problem with this is that I don't have a DatetimetoEltime function! I am on v8.7...maybe this is why?
I only have the datetimetostring and the stringtodate, but does not seem to work.
Only problem with this is that I don't have a DatetimetoEltime function! I am on v8.7...maybe this is why?
I only have the datetimetostring and the stringtodate, but does not seem to work.
Hm, true, TradeStation doesn't have that word (I'm a MultiCharts user). I've just scanned through the TradeStation 8.3 EasyLanguage manual, and using the reserved words that I found there, something like this should work..
Since I don't use TradeStation, I don't know if it would work, but it contains a workaround for not using DateTime2ELTime_s and thus (in theory) should work for TradeStation (it works here on MultiCharts fine).