[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Re: Recognising a new month starting



PureBytes Links

Trading Reference Links

Apparently, I hit "Return" instead of "Return to All" yesterday when replying to this so it didn't get sent to the list.

Bob Fulks


>Date: Wed, 05 Jan 2005 11:21:23 -0500
>To: "the.crocs" <the.crocs@xxxxxxxxxx>
>From: Bob Fulks <bfulks@xxxxxxxxxxxx>
>Subject: Re: Recognising a new month starting
>
>On re-reading it, I think your interpretation is probably correct. 
>He first says:
>
>>I'm struggling to find a way to get TS to see if 'today' is a new month
>>compared to the last trading bar.
>
>which means "is this bar a new month". But later says:
>
>>In summary, I want to know
>>if the next trading bar to appear on the chart will be in a new month
>>compared to the most recent bar on the chart. 
>
>
>Your solution will work in some cases. As I recall, TradeStation will not 
>let you refer to the next bar in certain cases. You can get around this by 
>using a "NextOpen" DLL available from some sources. 
>
>Also I noticed a mistake in my version. It should be:
>
>  if DOM < DOM[1] then begin
>
>to catch the first day of the month.
>
>Thanks
>
>Bob Fulks
>
>
>>At 10:06 AM 1/5/2005, you wrote:
>>
>>>On Wednesday, January 05, 2005 15:44 [GMT+1], Bob Fulks  wrote:
>>>
>>>>At 06:32 AM 1/5/2005, Adrian Pitt wrote:
>>>>
>>>>>I'm struggling to find a way to get TS to see if 'today' is a new month
>>>>>compared to the last trading bar.
>>>>
>>>>
>>>>How about:
>>>>
>>>>Var: DOM(0);
>>>>
>>>>DOM = DayOfMonth(Date);
>>>>
>>>>if DOM > DOM[1] then begin
>>>>  ...
>>>>end;
>>
>>
>>Hello,
>>
>>According to his email, it looks like Adrian wants to know in advance, ie if tomorrow will be a new month.
>>Thus I think what you need Adrian is the following:
>>
>>if month(date) <> month(date of tomorrow) then begin
>>....
>>end;
>>
>>Good trading.
>>
>>
>>