text_setlocation (value, date- 1,0900 , lowd ( 1 ) ) on Monday is not working properly
is a bug ?
see gif
Positioning error text on the chart on Monday [SOLVED]
Positioning error text on the chart on Monday
- Attachments
-
- bug pos monday.JPG
- (178.67 KiB) Downloaded 401 times
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Positioning error text on the chart on Monday
Because Date is in YYYMMdd format, it doesn't lend itself for arithmetic operations like subtracting 1. For example, if the date is 1 January 2015 (1150101), subtracting 1 gives 1150100, which would be the 0th of January.text_setlocation (value, date- 1,0900 , lowd ( 1 ) ) on Monday is not working properly
You'll need to use DateTime for date & time calculations, like so:
Code: Select all
Variables:
value(0),
dateValue(0);
dateValue = JulianToDate(DateTime - 1);
Text_SetLocation(value, dateValue, 900, lowd(1));
Re: Positioning error text on the chart on Monday
thanks for the reply , I have changed the code but the result is the same see gif.
If I change the day and insert the code works on Friday 01/23/2015 and so on except Monday.
If I change the day and insert the code works on Friday 01/23/2015 and so on except Monday.
- Attachments
-
- bug pos fr.JPG
- (72.92 KiB) Downloaded 389 times
-
- bug pos monday new code.JPG
- (157.9 KiB) Downloaded 394 times
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Positioning error text on the chart on Monday
Should the text "Monday" be placed at the first bar of Monday or at the very last bar?thanks for the reply , I have changed the code but the result is the same see gif.
If I change the day and insert the code works on Friday 01/23/2015 and so on except Monday.
In your indicator the following code occurs:
Code: Select all
value60 = Text_New(date, 1730, close, text("Monday"));
...
value6 = text_setlocation(value60, date, time+150, highd(0));
Or do you mean something else with 'the code doesn't work on Monday'?
Re: Positioning error text on the chart on Monday [SOLVED]
I solved the problem thanks to your help . sorry for my english
the text should be positioned at 0900 the previous day
the text should be positioned at 0900 the previous day
- Attachments
-
- solution.JPG
- (171.21 KiB) Downloaded 395 times