Hi,
I saw there is First Bar of Month indicator.
I'm trying to do paintbar for
4th full trading day of the month and
4th to last full trading day of the month.
Any help appreciated.
Thank you
Tony
Paint Bar on the 4th full trading of the month
- TJ
- Posts: 7752
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1034 times
- Been thanked: 2228 times
Re: Paint Bar on the 4th full trading of the month
4th trading day is easy...Hi,
I saw there is First Bar of Month indicator.
I'm trying to do paintbar for
4th full trading day of the month and
4th to last full trading day of the month.
Any help appreciated.
Thank you
Tony
just set up a counter,
reset the counter at the beginning of the month,
and increment the counter everyday.
You will have the 4th day when the counter = 4.
The last 4th day is a bit tricky.
You have to know the last trading days to do the math.
Re: Paint Bar on the 4th full trading of the month
This is what I have so far some modification on current code.
Only the 4th from last still no clue yet how to get the total day available on a particular month.
// Still not sure on how to only include full trading day only removing half day trading
//4th bar to last full trading day of the month
if (BarType < 4 and Month( Date ) <> Month( Date[1] ) ) then
begin
Value1=Arw_new_s(Date,Time_s, Low, FALSE); // Need to get 4 day before on the date ?
Value2 = Arw_setstyle( Value1, 3 );
Value2 = Arw_setsize( Value1, 2 );
end ;
// 4th bar full trading day of the month
if (BarType < 4 and Month( Date[3] ) <> Month( Date[2] ) ) then
begin
Value1=Arw_new_s(Date,Time_s, High, True);
Value2 = Arw_setstyle( Value1, 3 );
Value2 = Arw_setsize( Value1, 2 );
end ;
Only the 4th from last still no clue yet how to get the total day available on a particular month.
// Still not sure on how to only include full trading day only removing half day trading
//4th bar to last full trading day of the month
if (BarType < 4 and Month( Date ) <> Month( Date[1] ) ) then
begin
Value1=Arw_new_s(Date,Time_s, Low, FALSE); // Need to get 4 day before on the date ?
Value2 = Arw_setstyle( Value1, 3 );
Value2 = Arw_setsize( Value1, 2 );
end ;
// 4th bar full trading day of the month
if (BarType < 4 and Month( Date[3] ) <> Month( Date[2] ) ) then
begin
Value1=Arw_new_s(Date,Time_s, High, True);
Value2 = Arw_setstyle( Value1, 3 );
Value2 = Arw_setsize( Value1, 2 );
end ;
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: Paint Bar on the 4th full trading of the month
Dear Tony,
Could you please explain your question in details?
Could you please explain your question in details?
Re: Paint Bar on the 4th full trading of the month
Dave,
I saw there is First Bar of Month indicator.
I'm trying to do arrow/paintbar like in the First Bar of Month indicator for
the 4th full trading day of the month and
the 4th to last full trading day of the month.
It will skip if the trading day is only half day.
For example:
Oct 6th 2010 and Oct 26th 2010
Nov 4th 2010 and Nov 25th 2010
I think to be able to do this I need to read a file that have the calendar information which
include holiday and half day trading.
Thank you
Tony
I saw there is First Bar of Month indicator.
I'm trying to do arrow/paintbar like in the First Bar of Month indicator for
the 4th full trading day of the month and
the 4th to last full trading day of the month.
It will skip if the trading day is only half day.
For example:
Oct 6th 2010 and Oct 26th 2010
Nov 4th 2010 and Nov 25th 2010
I think to be able to do this I need to read a file that have the calendar information which
include holiday and half day trading.
Thank you
Tony
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: Paint Bar on the 4th full trading of the month
Dear Tony,I think to be able to do this I need to read a file that have the calendar information which
include holiday and half day trading.
Yes, you will need to hardcode it: write it in the script or read it from a file thru external dll. Basically, you should skip holidays by means of your script.
- furytrader
- Posts: 354
- Joined: 30 Jul 2010
- Location: Chicago, IL
- Has thanked: 155 times
- Been thanked: 217 times
Re: Paint Bar on the 4th full trading of the month
Would this be on a daily chart? The challenge with end-of-day charts is that they'll give you the same timestamp, irrespective of whether it was a holiday-shortened session or not. As Dave mentioned, you may need to hardcode the dates then.