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

Re: [amibroker] Re: Testing for new bar using string manipulation and quotation time


  • To: "Barry Scarborough" <razzbarry@xxxxxxxxxxxx>
  • Subject: Re: [amibroker] Re: Testing for new bar using string manipulation and quotation time
  • From: Herman <psytek@xxxxxxxx>
  • Date: Wed, 18 Mar 2009 11:03:04 -0400

PureBytes Links

Trading Reference Links

Title: Re: [amibroker] Re: Testing for new bar using string manipulation and quotation time

If the one second refresh comes before the next quote and you act on it, it allows you to place orders 'before' the next quote comes in. This increases your change of a fill. It doesn't matter what the chart shows or what time-stamps are doing.


Not sure what you are doing, but if you are AT trading in real time and you want to synchronize your action with time, you are often better of using Now() as your timing source and calculate your own RT periods, independent of charts and quote arrival. 


For the best response you would trade whichever comes first, the one-sec refresh or the quote, i.e. work with the highest refresh rates possible. This applies to end of bar or begin of bar systems.


herman




  



Wednesday, March 18, 2009, 10:38:29 AM, you wrote:


> What is your point Herman? I use RequestTimedRefresh(1) in the program I

> traced to determine when TimeNum changed. TimeNum changed when the first tick

> arrived, as I stated, regardless of the actual time of day. The following

> trace statement shows TimeNum did not change until 4 seconds into the new bar.

> Earlier today before the market opened TimeNum did not change until 20 seconds into the new bar.


> 4939 10:26:04 AM [184] #, Main, BarCtrl, NewBar = True, OldBarTime = 102500, NewBarTime = 102600


> This is the code I use to test for a new bar


> // Check if new bar

> OldBarTime = StaticVarGet(VarPfx + "BarTime");

> NewBarTime = LastValue(TimeNum());

> if(      OldBarTime != NewBarTime )

>         NewBar = True;

> else

>         NewBar = False;

> if(DebugOn) _TRACE("#, Main, BarCtrl" + WriteIf(newBar, ", NewBar =   True",

> ", NewBar = False") + ", OldBarTime = " + NumToStr(OldBarTime, 1, False) + ",

> NewBarTime = " + NumToStr(NewBarTime , 1, False) );

> StaticVarSet(VarPfx + "BarTime", LastValue(TimeNum()));


> I set the static var BarTime to LastValue(TimeNum())in my init routine to

> prevent signaling a new bar in the middle of a bar. It will not signal a new bar until the next bar starts.


> Barry





> ------------------------------------


> **** IMPORTANT PLEASE READ ****

> This group is for the discussion between users only.

> This is *NOT* technical support channel.


> TO GET TECHNICAL SUPPORT send an e-mail directly to 

> SUPPORT {at} amibroker.com


> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at

> http://www.amibroker.com/feedback/

> (submissions sent via other channels won't be considered)


> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:

> http://www.amibroker.com/devlog/


> Yahoo! Groups Links


> <*> To visit your group on the web, go to:

>     http://groups.yahoo.com/group/amibroker/


> <*> Your email settings:

>     Individual Email | Traditional


> <*> To change settings online go to:

>     http://groups.yahoo.com/group/amibroker/join

>     (Yahoo! ID required)


> <*> To change settings via email:

>     mailto:amibroker-digest@xxxxxxxxxxxxxxx 

>     mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx


> <*> To unsubscribe from this group, send an email to:

>     amibroker-unsubscribe@xxxxxxxxxxxxxxx


> <*> Your use of Yahoo! Groups is subject to:

>     http://docs.yahoo.com/info/terms/





__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___