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

[amibroker] Multiple time-frame indicators



PureBytes Links

Trading Reference Links

Hi:

I'm currently working with Amibroker during my free trial period.
Since there is obviously a considerable learning curve associated with
writing new indicators I decided to start with something that should
have been simple.  I decided to add a new indicator (a Multiple
time-frame MACD) to Amibroker by following the instructions at

http://www.amibroker.com/docs/MTFIndicators.html

This is essentially a cut and past operation.
 

Two requirements were stated for running the indicator

    * AmiBroker (any edition, any version above 4.41) - I used v 5.10
    * Any 1-minute intraday data source - ok

both of which were satisfied. 

The installation instructions and the problems that I encountered as a
result were as follows:

In order to run this code and calculate multiple time-frame MACD:

1. Enter it into Automatic Analysis (AA) window:

Problem: The Automatic Analysis window did not provide an entry
screen.  I tried various methods until I found one that ran the code.
I subsequently found that the Formula Editor worked as well. It had an
entry screen and a scan button.  The results were the same regardless
of whether the Automatic Analysis or Formula Editor was used.


2. Go to Settings window, make sure that Periodicity is set to
1-minute. This was accomplished with no problem.


3. Press "Scan" button in the AA window.
Problem: The scan function did run.  The result was that it assigned a
buy signal to every minute of every day for all symbols in my database
for their entire history. 

The code, provided by Tomasz Janeczko, for this indicator was as follows:

---BEGIN CODE ---

Count = 0;
result = 0;

for( i = 10; i <= 300; i++ )
{
   TimeFrameSet( i * in1Minute );
   m = MACD(12, 26 );
   TimeFrameRestore();
   m = IIf( TimeFrameExpand( m, i * in1Minute ) > 0, 1, -1 );
   result = result + m;
   Count++;
}

AddToComposite( result / Count, "~MACD"+Name(), "X" );
Buy=1;

---END CODE---

Could someone please tell me what I did wrong. How do I obtain the
result illustrated in the How To? This is the first time that I can
remember being defeated by what is essentially a cut and paste
operation. Thanks.  


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

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