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

[amibroker] Re: Something New?



PureBytes Links

Trading Reference Links

It's just much nicer to see a german stock compared with the dax 
without having to change things manually. So I added different 
default values for the comparison, aplly your own needs everybody..
This is the correct version, sorry for posting faulty code...

if (GroupID() == 6 OR GroupID() == 7 )
CompareTickerDefault = "^GDAXI";
else
CompareTickerDefault = "^IXIC";

CompareTicker = ParamStr( "Compare "+Name()+" 
with:",CompareTickerDefault);

BarIsVisible = Status("barvisible");
firstBarVisible = BarIsVisible AND NOT Ref( BarIsVisible, -1 );
BarsVisible = LastValue(BarsSince (FirstBarVisible))+1;

ZeroTrigger = BarsVisible/2; //Days to go back for ZeroPoint

TimeArray = IIf (BarIndex () < LastValue( BarIndex()) - ZeroTrigger 
+1 ,0,1);
ZeroPoint = TimeArray AND NOT Ref( TimeArray, -1 );
ZeroPointValueTicker = LastValue( ValueWhen (ZeroPoint,C));

ScaledTickerArray = 100 * C / ZeroPointValueTicker;
Plot(ScaledTickerArray,Name(),colorRed,styleLine);

CompareArray = Foreign(CompareTicker,"C");
ZeroPointValueCompare = LastValue( ValueWhen 
(ZeroPoint,CompareArray));

ScaledCompareArray = 100*CompareArray / ZeroPointValueCompare;
Plot(ScaledCompareArray,CompareTicker,colorBlue,styleLine);

> 
> if (GroupID() == 6 OR 7 )
> CompareTickerDefault = "^GDAXI";
> else
> CompareTickerDefault = "^IXIC";
> 
> CompareTicker = ParamStr( "Compare "+Name()+" 
> with:",CompareTickerDefault);
> 
> BarIsVisible = Status("barvisible");
> firstBarVisible = BarIsVisible AND NOT Ref( BarIsVisible, -1 );
> BarsVisible = LastValue(BarsSince (FirstBarVisible))+1;
> 
> ZeroTrigger = BarsVisible/2; //Days to go back for ZeroPoint
> 
> TimeArray = IIf (BarIndex () < LastValue( BarIndex()) - ZeroTrigger 
> +1 ,0,1);
> ZeroPoint = TimeArray AND NOT Ref( TimeArray, -1 );
> ZeroPointValueTicker = LastValue( ValueWhen (ZeroPoint,C));
> 
> ScaledTickerArray = 100 * C / ZeroPointValueTicker;
> Plot(ScaledTickerArray,Name(),colorRed,styleLine);
> 
> CompareArray = Foreign(CompareTicker,"C");
> ZeroPointValueCompare = LastValue( ValueWhen 
> (ZeroPoint,CompareArray));
> 
> ScaledCompareArray = 100*CompareArray / ZeroPointValueCompare;
> Plot(ScaledCompareArray,CompareTicker,colorBlue,styleLine);



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
---------------------------------------------------------------------~->

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/