Hi.
Is the text_setlocation keyword only able to draw text on a price value?
Imagine that I want to draw the text in the top left of the chart (or subchart) or in one of the other 3 corners, or even in the middle of the chart.
How can I do this?
Regards,
Fernando
Text Location
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Hi.
Is the text_setlocation keyword only able to draw text on a price value?
Imagine that I want to draw the text in the top left of the chart (or subchart)
or in one of the other 3 corners,
or even in the middle of the chart.
How can I do this?
Regards,
Fernando
the keyword requires 4 inputs.
Three of them determines the coordinates of the text on your chart:
1. date
2. time
3. price
the date value does not have to be the current bar's date,
the time value does not have to be the current bar's time,
the price value does not have to be the current bar's price.
you can position the text on any date, time and price combinations.
Try this stuff to get your chart corners. I gather it works on the newer MC. It is rough. I could not get the top/bottom commands to work in MC 2.1.999.999 so I stopped working on it. I should try and get back to it some time. These are in the easy language help under "GetAppInfo".
aiHighestDispValue - specifies return of the highest price value that could be displayed in the current chart window GetAppInfo will return the highest price value that could be displayed on a chart
aiLowestDispValue - specifies return of the lowest price value that could be displayed in the current chart window GetAppInfo will return the lowest price value that could be displayed on a chart.
{these 6 input fields are used for positioning the interactive text (and the flag text) on the screen so they can always be seen}
Input: Beg_BarsBackFromLast(5);
Input: Beg_UnitsAboveClose(2);
Input: End_BarsBackFromLast(9);
Input: End_UnitsAboveClose(2);
Input: Flag_BarsBackFromLast(13);
Input: Flag_UnitsAboveClose(2);
variables:
intrabarpersist Text_New_Needed("Y"),
intrabarpersist FlagStatus("N"),
Begin_ID(0),
End_ID(0),
Flag_ID(0),
Begin_Time(0),
End_Time(0),
Flag_Time(0),
Begin_Price(0),
End_Price(0),
Flag_Price(0),
MySym("");
{Determine the bar location to place the interactive "B" and "E" text which you highlight. flag text is just out front}
{
Begin_Time = MinutesToTime(TimeToMinutes(Time) - Beg_BarsBackFromLast);
End_Time = MinutesToTime(TimeToMinutes(Time) - End_BarsBackFromLast);
Flag_Time = MinutesToTime(TimeToMinutes(Time) - Flag_BarsBackFromLast);
}
Begin_Time = MinutesToTime(TimeToMinutes(DateTime2ELTime(GetAppInfo(aiLeftDispDateTime))) + Beg_BarsBackFromLast);
End_Time = MinutesToTime(TimeToMinutes(DateTime2ELTime(GetAppInfo(aiLeftDispDateTime))) + End_BarsBackFromLast);
Flag_Time = MinutesToTime(TimeToMinutes(DateTime2ELTime(GetAppInfo(aiLeftDispDateTime))) + Flag_BarsBackFromLast);
Print(File("C:\alog_A_TestTicks_2of3_BegEnd_GetAppInfo.txt"),
"Begin_Time", " " ,
Begin_Time, " " ,
"GetAppInfo(aiLeftDispDateTime)", " " ,
GetAppInfo(aiLeftDispDateTime), " " ,
"DateTime2ELTime(GetAppInfo(aiLeftDispDateTime))", " " ,
DateTime2ELTime(GetAppInfo(aiLeftDispDateTime)), " " ,
" ");
aiHighestDispValue - specifies return of the highest price value that could be displayed in the current chart window GetAppInfo will return the highest price value that could be displayed on a chart
aiLowestDispValue - specifies return of the lowest price value that could be displayed in the current chart window GetAppInfo will return the lowest price value that could be displayed on a chart.
{these 6 input fields are used for positioning the interactive text (and the flag text) on the screen so they can always be seen}
Input: Beg_BarsBackFromLast(5);
Input: Beg_UnitsAboveClose(2);
Input: End_BarsBackFromLast(9);
Input: End_UnitsAboveClose(2);
Input: Flag_BarsBackFromLast(13);
Input: Flag_UnitsAboveClose(2);
variables:
intrabarpersist Text_New_Needed("Y"),
intrabarpersist FlagStatus("N"),
Begin_ID(0),
End_ID(0),
Flag_ID(0),
Begin_Time(0),
End_Time(0),
Flag_Time(0),
Begin_Price(0),
End_Price(0),
Flag_Price(0),
MySym("");
{Determine the bar location to place the interactive "B" and "E" text which you highlight. flag text is just out front}
{
Begin_Time = MinutesToTime(TimeToMinutes(Time) - Beg_BarsBackFromLast);
End_Time = MinutesToTime(TimeToMinutes(Time) - End_BarsBackFromLast);
Flag_Time = MinutesToTime(TimeToMinutes(Time) - Flag_BarsBackFromLast);
}
Begin_Time = MinutesToTime(TimeToMinutes(DateTime2ELTime(GetAppInfo(aiLeftDispDateTime))) + Beg_BarsBackFromLast);
End_Time = MinutesToTime(TimeToMinutes(DateTime2ELTime(GetAppInfo(aiLeftDispDateTime))) + End_BarsBackFromLast);
Flag_Time = MinutesToTime(TimeToMinutes(DateTime2ELTime(GetAppInfo(aiLeftDispDateTime))) + Flag_BarsBackFromLast);
Print(File("C:\alog_A_TestTicks_2of3_BegEnd_GetAppInfo.txt"),
"Begin_Time", " " ,
Begin_Time, " " ,
"GetAppInfo(aiLeftDispDateTime)", " " ,
GetAppInfo(aiLeftDispDateTime), " " ,
"DateTime2ELTime(GetAppInfo(aiLeftDispDateTime))", " " ,
DateTime2ELTime(GetAppInfo(aiLeftDispDateTime)), " " ,
" ");
Last edited by bowlesj3 on 30 Jan 2010, edited 1 time in total.
Hi SP,
Yes. I cut and paste it from my calendar reminder text (something I use to keep aware of important things I might want to use in the future). I should have put the script name in there. I will try and find it. For now you just have to define them yourself. It shows some useful calculation commands.
I just dropped the variables in. It has been a long time since I looked at this. I am not sure if it works (fully proper)
John.
Yes. I cut and paste it from my calendar reminder text (something I use to keep aware of important things I might want to use in the future). I should have put the script name in there. I will try and find it. For now you just have to define them yourself. It shows some useful calculation commands.
I just dropped the variables in. It has been a long time since I looked at this. I am not sure if it works (fully proper)
John.
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Please see attached image.
Having this indicator plotted 3 times under the ES chart, I can follow the volume during the 3 time periods.
The idea is to have the text in a visible area, telling me the respective time period. The ideal location is obviously near the "status line" of the chart and subchart, as indicated by the arrows in the image.
The GetAppInfo keyword and all it's parameters don't work in the subcharts.
No doubt that the best way to solve this would be to create a specific keyword for that area (status line) of the chart and subchart.
Having this indicator plotted 3 times under the ES chart, I can follow the volume during the 3 time periods.
The idea is to have the text in a visible area, telling me the respective time period. The ideal location is obviously near the "status line" of the chart and subchart, as indicated by the arrows in the image.
The GetAppInfo keyword and all it's parameters don't work in the subcharts.
No doubt that the best way to solve this would be to create a specific keyword for that area (status line) of the chart and subchart.
- Attachments
-
- text image.png
- (49.67 KiB) Downloaded 577 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
If you create a plot at the very top and bottom of the subchart 2 (like RSI 100 and RSI 0) and double click on the right scale to center it you should be able to force text up to that area of the chart (above the 100 line actually) As far as bars back you could compute that and also get the bar spacing distance to adjust it as well if the bars are set wider. There is a reserve word for that. It is doable on subchart #2 for sure.
My RSI is this way (and any other studies that I put on subchart#2 to force them to line up with the RSI) and the scaling range is set to "screen" and linear is used and top/bottom of 5%. It tool a lot of work to figure out that all subchart #2 studies have to have these two top and bottom plots to force things to line up properly.
My RSI is this way (and any other studies that I put on subchart#2 to force them to line up with the RSI) and the scaling range is set to "screen" and linear is used and top/bottom of 5%. It tool a lot of work to figure out that all subchart #2 studies have to have these two top and bottom plots to force things to line up properly.