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

[amibroker] Setting Chart Timeframe via AFL



PureBytes Links

Trading Reference Links

Hello,

I have used a method to set the chart timeframe via AFL for a very  
long time now (over a year).  It is ugly, but since I was the only one  
using it, I lived with it.  However, I now convinced a trading friend  
to switch to AB and use my platform code to develop his trading  
systems.  That means in a couple of weeks, I am going to have to share  
the ugliness with him.  I would like a more elegant simple way of  
doing it, but I have never thought of a better way.  Perhaps I have  
missed something.

What I do now:

One time:
1.    Install AutoIt
2.    Install my #Include
Every time I start AB:
1.    Open the Preferences Window
2.    Select the Intraday Tab
3.    Drag the Preferences Window below the bottom of my screen.
4.    Leave the preferences Window open on the Intraday Tab as long as  
AB is running.
What it does:
1.    Detect when a parameter or UI button selects a different  
timeframe.
2.    Activate the Preferences Window.
3.    Send number text via AutoIt to one of 4 pre set up custom time,  
tick, volume, or range fields.
4.    Send a click via AutoIt to the apply button.

This is the only reason I have AutoIt loaded on my system at this time.

Below is a JScript function I use to set the current ticker name for  
my chart.  This saved me a lot of trouble when It was made available  
by TJ. It seems that a similar method could be used to set the  
timeframe of the chart.  However, I am not aware of that being  
possible at this time.

Does a simpler method than the one I currently use exist yet?
Can I do it by another method that does not require AutoIt and leaving  
the Preferences Window open
(short of spending two weeks chasing everything I would need know to  
make another DLL)?
There are a number of old suggestions related to this area already.
I have been waiting patiently for TJ to add some way to make this work  
in AFL, but I have a new reason to need it cleaned up sooner now.

//================================================================
// jscript FUNCTION to change the active ticker symbol
// Call this function once at the end of the AFL formula
// Only call it to change tickers, not all the time
// It is called with the following:
// If(TickerChanged){
//	script = GetScriptObject();
//	script.SetChartTicker("MSFT");}
//
EnableScript("JScript");
<%
function SetChartTicker(newTicker){
	AB = new ActiveXObject("Broker.Application");
	AB.ActiveDocument.Name = newTicker;
	return 1;
}
%>

Best regards,
Dennis

------------------------------------

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

*********************
TO GET TECHNICAL 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

*********************************
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/