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

[amibroker] STOC RSI



PureBytes Links

Trading Reference Links

The Conditions:
    1    EOD data-base only, no one minute data-base

    2    Updating only the current day of EOD data-base with one minute
quotes.

The Goal:
    To capture the one minute updates to the EOD database and produce a
one-minute A/D line.

So far:
    The following code runs and captures the EOD A/D line for the EOD
data-base.  The value for the current day varies with the one-minute updates
to the current day.

The Problem:
    If the following code is run in AA, then it shows the last element in
the array to be the correct value for the current day A/D (using
addcolumn)so the array would seem to be ok.  However, it will not plot.
Have tried "TimeFrameSet" & "TimeFrameRestore" with no effect.

Any suggestions, help, insight would be greatly appreciated.  Hopefully this
will help the timing of orders.


// Test Intraday A-D

SetBarsRequired(400, 0);

intrad[400] = 0.0001; // To initialize array

WLno=7; // The watch-list selected for the A/D line.

Adv = 0; Dec=0;unch=0;

for( i = 0; ( sym=StrExtract(CategoryGetSymbols(

categoryWatchlist, WLno)

, i ) ) != ""; i++ )

{

SetForeign(sym);

r=ROC(C,1);

adv=(r>0)+adv;

unch=(r==0)+unch;

dec=(r<0)+dec;

}

// To change to percentages to accomodate various lengths of watch-list

adv = (adv/(adv+unch+dec))*100;

unch = (unch/(adv+unch+dec))*100;

dec = (dec/(adv+unch+dec))*100;

// To capture the most recent update of the A/D (the daily price is updated
each minute)

Lva = LastValue(adv);

Lvd = LastValue(dec);

Lvu = LastValue(unch);

// To set up an array with the "minute" updates of the A/D captured above.

for (i = 2; i< 81; i++)

{

intrad[i-1] = intrad[i];

}

intrad[400] = (Lva-Lvd);

Plot (intrad, "Intraday A/D", colorWhite, styleLine);



//Plot(adv-dec, "adv-dec",colorYellow, styleLine);

//Plot(EMA(adv-dec, 15), "EMA-10", colorLightBlue, styleLine);


Filter=1;

AddColumn(adv,"adv",1.0);

AddColumn(unch,"unch",1.0);

AddColumn(dec,"dec",1.0);

AddColumn(adv+unch+dec,"total",1.0);









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

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