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

[amibroker] Need help with programming


  • Date: Thu, 18 Mar 2010 01:07:45 -0000
  • From: "JEFF F" <jefff@xxxxxxxxxx>
  • Subject: [amibroker] Need help with programming

PureBytes Links

Trading Reference Links

I have created this simple system in excel and would like to try to convert it to AFL. If anyone can help, I would appreciate it. 

===================================DEFINITIONS=======================================
MACD = EMA12 ? EMA26
9 Day Signal = 9 Day Average MACD
Histogram = MACD - 9 Day Signal
==================================== Hist Trend ========================================
Hist Trend = If Histogram > 0, 1, -1
=IF(Histogram Today >0 , IF(Hist Trend Yesterday = 5 , 5, Hist Trend Yesterday +1) , IF(Histogram Today > Histogram Yesterday , Hist Trend Yesterday , IF(Hist Trend Yesterday =-5 , -5, Hist Trend Yesterday -1)))
==================================== MACD Trend ======================================
MACD Trend = If MACD > 0, 1, -1
=IF(MACD Today > 0 , IF(MACD Trend Yesterday = 5 , 5, MACD Trend Yesterday +1) , IF(MACD Today > MACD Yesterday , MACD Trend Yesterday , IF(MACD Trend Yesterday = -5 , -5 , MACD Trend Yesterday -1)))
===================================== MA Trend =======================================
MA Trend = IF (Close > MA20 , 1 , -1)
=IF(Close Today > MA20 Today , IF(MA Trend Yesterday = 5 , 5, MA Trend Yesterday +1) , IF(Close Today > Close Yesterday, MA Trend Yesterday , IF(MA Trend Yesterday = -5 , -5 , MA Trend Yesterday -1)))
======================================TREND=========================================
Trend = (Hist Trend + (MACD Trend * 3) + (MA Trend * 2)) / 6    //Weighted Average of Three Trend Indicators
Trend Average = AVERAGE (10 Day Trend)
=IF (Trend Average Today >= 0 , IF (Trend Average Yesterday < 0 , "BUY" , "Hold") , IF (Trend Average Yesterday > 0 , "SELL" , "Hold"))
=========================================END========================================




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

**** 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:
    amibroker-digest@xxxxxxxxxxxxxxx 
    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/