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

Re: [amibroker] Re: Chart Refresh



PureBytes Links

Trading Reference Links

Yes that is correct.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
Sent: Thursday, April 10, 2008 2:12 AM
Subject: Re: [amibroker] Re: Chart Refresh

Tomasz,

Thank you for the detailed explanation of why my idea will not work due to Windows limitations.  I had wondered about some of the GUI unresponsiveness when running a large AFL.  Now I understand it is related to this same problem with Windows.

(Please forgive me if my ignorance of Windows internals makes my comments below sound nonsensical from your point of view)

So If I understand this correctly, if we want to do high speed interactions with the chart, like dragging a GFX element (and see the results displayed) we need a way to refresh the chart at high speeds, even when there is no data coming in.  

That being the case, we would need to have a refresh mode for an immediate refresh of the chart --as soon as the as the application message queue has been emptied, and any other needed housekeeping functions are done.  That would keep the AFL running and also allow for the UI processing to have precedence so the AFL will not lock up the system.

Best regards,
Dennis

On Apr 9, 2008, at 6:39 PM, Tomasz Janeczko wrote:
Dennis,
 
GetCursorMouseButtons returns "asynchronous" state of mouse buttons (via GetAsyncKeyState) i.e. at the time of the call (not latched),
but there is some other thing to consider.
 
We are coming to Windows operating system inner workings. Some of these inner workings are left overs from old days when
windows was not pre-emptive multi tasking and relied on applications to return to message loop so Windows could switch the tasks.
Our dear Redmontians changed kernel, but the graphic subsystem still uses some old ideas.
 
In Windows the system does not handle GUI updating by itself, instead it relies on application to update all GUI and all graphics during regular
message processing queue. Windows goes even further - WM_PAINT message is  sent when there are NO other messages in the applicaiton message queue.
See:
 
So the window won't actually paint anything until you finish with your AFL formula.
 
So even if you can track "real-time" mouse position and buttons nothing will be painted until you actually finish the execution of the formula.
 
"Dragging" in Windows is actually implemented as a series of paint messages sent in sequence (paint message - > application draws something
in one position then control returns, then again paint message-> drawing in new position and again and again.)

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
Sent: Wednesday, April 09, 2008 11:50 PM
Subject: Re: [amibroker] Re: Chart Refresh

Hello Tomasz,

Reading your reply to Herman below, triggers an idea in my mind.

Let's say that I wanted to handle dragging a GFX drawn button around the chart.  If I were to write code as you suggested inside a loop while the mouse was still down, would AB be able to keep the state of the mouse buttons true to the current state, Or does AB have to exit the AFL and run the GUI code to make that work correctly --meaning that the state of the mouse buttons is latched at the beginning of the AFL execution and does not change?

Best regards,
Dennis


On Apr 9, 2008, at 5:36 PM, Tomasz Janeczko wrote:
Hello,
 
Refresh is identical - it just requests chart redraw that subsequently executes your code. It does not matter
how refresh is triggered.
 
As to your second question: if you want your code re-executed immediatelly because conditions have changed
you can easily do so:
 
ConditionsChanged = False;
 
do
{
 ... your entire formula
 
 if( something ) ConditionsChanged = True;
}
while( ConditionsChanged );
 
Note that this may lead to infinite loop if your coding is setting "ConditionsChanged" variable to true value non-stop.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: Herman
Sent: Wednesday, April 09, 2008 11:19 PM
Subject: Re: [amibroker] Re: Chart Refresh

Tomasz, could you explain the difference between a quote-driven, timed, and RefreshAll?

It appears to me that they do not work the same way with respect to ticker tree and WatchList refreshes. 

Also, sometimes when conditions change at the end of a long program and you want preceding code executed right away, i.e, not at a random interval that may last up to one second during slow trading hours, calling the RefreshAll() appears the only way.

Many thanks,
herman

For tips on developing Real-Time Auto-Trading systems visit:

Wednesday, April 9, 2008, 12:38:25 PM, you wrote:

>
Hello,

 

Remove this code completely. It is redundant and should not be used at all.

 

As I wrote previously the code executes for all OPEN and visible charts automatically.
There is no need to put any refresh statements. 

 

But...

 

You don't have charts open for other symbols that's why you don't get e-mails for other symbols.

 

To get e-mails for multiple symbols you can either:

 

a) open multiple charts for many symbols (http://www.amibroker.com/video/TwoSymbols.html)
OR
b) use automatic analysis  to scan many symbols periodically using "Run Every" feature
OR
c) use loop inside the formula and SetForeign function to iterate through symbols 

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: Mohammed 
Sent: Wednesday, April 09, 2008 5:25 PM
Subject: [amibroker] Re: Chart Refresh

Hello Tomasz;
Now I do Add the following formula in the underlying AFL code, 
------
RequestTimedRefresh(1); 
function
RefreshAll() 
{
oAB = CreateObject"Broker.Application" );
oAB.RefreshAll();
}
Buy
C < O
AlertIfBuy"EMAIL""BUY "+FullName(), 1 );
------
The Active chart is "EURDUS" and I received the alert each 15M, If the bar close red. And this is very nice. 
BUT I only get the alert for the active chart, the other pairs I didn't get any alert for it if the bar close red.
How can I get the alert for all pair I have in "ALL folder"?
Regards.

 


--- In amibroker@xxxxxxxxxxxxxxx, "umrperumal" <umrperumal@xxx> wrote:
>
> Hi TJ,
> If I click right mouse button over the chart and choose "Edit 
> Formula", the formula is available to anybody for edit. Is there 
> any way to "password protect the formula", so that the formula is 
> not tampered by others sitting on the pc in my absence.
> With kind regards
> UMR Perumal
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" groups@ 
> wrote:
> >
> > Underlying code is the code that chart uses - available if you 
> click with RIGHT mouse
> > button over the chart and choose "Edit Formula"
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: "Mohammed" softnews2003@
> > Sent: Wednesday, April 09, 2008 5:34 AM
> > Subject: [amibroker] Re: Chart Refresh
> > 
> > 
> > > Hello Tomasz,
> > > 
> > > Thank you for your reply.
> > > 
> > > Could you please clear what you mean by "underlying AFL code"
> > > 
> > > Regards
> > > 
> > > 
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@> 
> > > wrote:
> > >>
> > >> All visible charts are refreshed.
> > >> Invisible charts can be refreshed too if you add 
> > > RequestTimedRefresh function
> > >> in the underlying AFL code.
> > >> 
> > >> Best regards,
> > >> Tomasz Janeczko
> > >> amibroker.com
> > >> ----- Original Message ----- 
> > >> From: "Mohammed" <softnews2003@>
> > >> Sent: Tuesday, April 08, 2008 11:03 PM
> > >> Subject: [amibroker] Chart Refresh
> > >> 
> > >> 
> > >> > Hollo folks,
> > >> > 
> > >> > I'm still have confusion of data refresh in AB,
> > >> > 
> > >> > Dose AB refreshes all charts or only the active chart, If 
> only 
> > > active 
> > >> > chart is there any way to make it refresh all symbols in the 
> all 
> > > list? 
> > >> > 
> > >> > I need this for Email notification.
> > >> > 
> > >> > Thank you for advice.
> > >> > Regards
> > >> > 
> > >> > 
> > >> > ------------------------------------
> > >> > 
> > >> > Please note that this group is for discussion between users 
> only.
> > >> > 
> > >> > To get support from AmiBroker please send an e-mail directly 
> to 
> > >> > SUPPORT {at} amibroker.com
> > >> > 
> > >> > For NEW RELEASE ANNOUNCEMENTS and other news always check 
> DEVLOG:
> > >> > 
> > >> > For other support material please check also:
> > >> > Yahoo! Groups Links
> > >> > 
> > >> > 
> > >> >
> > >>
> > > 
> > > 
> > > 
> > > ------------------------------------
> > > 
> > > Please note that this group is for discussion between users only.
> > > 
> > > To get support from AmiBroker please send an e-mail directly to 
> > > SUPPORT {at} amibroker.com
> > > 
> > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > > 
> > > For other support material please check also:
> > > Yahoo! Groups Links
> > > 
> > > 
> > >
> >
>

 



__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html




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

__,_._,___