| TradeStation Custom Programming Discuss projects, ideas, obstacles in programming with TradeStation. |
![]() | | Tweet | |
| | #1 | ||
| Dynamic Text Box 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. Any clue? thanks a lot | |||
| |
|
| | #2 | ||
| Re: Dynamic Text Box Code: vars: IntrabarPersist date_1(0), IntrabarPersist time_1(0), IntrabarPersist price_1(0); date_1 = getappinfo(aiLeftDispDate Time); time_1 = getappinfo(aiLeftDispDate Time); price_1 = getappinfo(aiHighestDispV alue)-offset_points*2; if symbol = "GS:EUR A0-FX" and (time_1<>time_1[1] or price_1<>price_1[1]) then print( symbol, "data-> ", StringToDate(DateTimeToSt ring(getappinfo(aiLeftDis pDateTime))), "string data->", datetostring(StringToDate (DateTimeToString(getappi nfo(aiLeftDispDateTime))) ), "ora-> ", StringTotime(DateTimeToSt ring(getappinfo(aiLeftDis pDateTime)))," ", "string time->", timetostring(StringTotime (DateTimeToString(getappi nfo(aiLeftDispDateTime))) ), " ", getappinfo(aiHighestDispV alue):0:4, setup_count_buy," ", setup_count_sell, " ", getappinfo(aiLeftDispDate Time) ); 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(i d_3, date_1, time_1, price_1); end; I inserted also the print command to verify that the calculated values are the one desired, and I can confirm this. But what I get from text_new is the text is plotted at the correct price level [getappinfo(aiHighestDispV alue)-offset_points*2] but at the wrong date/time combination (the text is actually positioned on the first bar of the entire series, not on the first bar displayed). I have also tried converting the date&time to string and then back to value, but it makes no difference: date_1 = StringToDate(DateTimeToSt ring(getappinfo(aiLeftDis pDateTime))); time_1 = StringTotime(DateTimeToSt ring(getappinfo(aiLeftDis pDateTime))); thanks | |||
| |
|
| | #3 | ||
![]() | Re: Dynamic Text Box Here is some simple code that displays the output on the chart. I suggest that you separate out things into small sections of code that you can get to work, with some way of seeing what the output is. This indicator shows what the output of the code is in the upper right hand corner of the screen. In the upper right hand corner, it shows the date and time of the first bar on the chart. Code: var: DateString(" ");
Once
begin
Value1 = Text_New( D, T, getappinfo(aiHighestDispValue), " Begin" );
end;
DateString = DateTimeToString(getappinfo(aiLeftDispDateTime));
Text_SetString(Value1, DateString);
Text_SetLocation(Value1, D, T, getappinfo(aiHighestDispValue) - 0.5);
Text_SetStyle(Value1, 0, 2);
__________________ Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens. | ||
| |
|
| | #4 | ||
![]() | Re: Dynamic Text Box var: id(text_new(d,t,c,"hello world")), x(text_setstyle(id,0,0)), intrabarpersist xd(0), intrabarpersist xt(0), intrabarpersist xp(0); xd=juliantodate(intPortio n(getappinfo(aiLeftDispDa teTime))); xt=minutesToTime(fracport ion(getappinfo(aiLeftDisp DateTime))*24*60); xp=getappinfo(aiHighestDi spValue); text_setlocation(id,xd,xt ,xp); | ||
| |
|
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dynamic Stop Loss | bdlagno55 | Automated Trading | 0 | 03-05-2011 10:08 AM |
| Dynamic VWAP with StdDevs for SC | Hlm | Trading Indicators | 5 | 05-08-2010 02:04 AM |
| Robert Miner--Dynamic Trader | pandion | Swing Trading and Position Trading | 8 | 03-28-2010 04:12 PM |
| Tro Dynamic Fibs Sr | TheRumpledOne | Trading Indicators | 16 | 09-03-2009 05:43 PM |
| Dynamic Risk to Reward | AbeSmith | Trading and the Markets | 4 | 08-17-2009 03:32 AM |