Skip to content
View in the app

A better way to browse. Learn more.

Tom Next - Trading Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Selbsterstellter Index durch Amibroker möglich?

Hallo zusammen,

häufig hat es sich als sinnvoll erwiesen, den Trend des übergeordnete Index eines getradeten Marktes als Filter zu verwendet. Dabei ist soll der Index definitionsgemäß den Markt abdecken, d.h. er ist entsprechend der Marktkapitalisierung gewichtet. Meine Positionsgröße bestimme ich aber für alle Aktien gleichgewichtet als Anteil meines Kapitals.

Meine Idee ist, einen selbsberechneten, gleichgewichteten Index über die von mir zu handelnden Aktien zu erstellen, den ich dann als Filter verwende.

Ich habe versucht, dieses über AmiBroker zu programmieren, komme aber nicht über die Hürde, auf mehr als eine fremde Aktie zuzugreifen. "foreign" kann man nach meinen Versuchen nur einmal anwenden, d.h. ich kann nicht mehr als einen externen Zugriff tätigen, geschweige denn 30 oder 50.

Klar kann ich die Berechnung auch außerhalb von AmiBroker in Excel durchführen, aber der Aufwand mit Kursex- und -import ist sehr groß und muss dan täglich wiederholt werden.

 

Hat jemand eine Idee, wie man das Problem lösen könnte?

Featured Replies

Eine wirkliche Lösung habe ich auch nicht.

Das einzige was mir einfällt wo Du vielleicht mal schauen kannst ist der Code vom Relative Performance Chart.

 

Dort wird doch auch auf mehrere Werte zugegriffen.

In wie weit Du damit nachher Arbeiten kannst weiss ich leider nicht.

 

_N( TickerList = ParamStr("Tickers", "^DJI,MSFT,GE") );
NumBars = 20;
fvb = Status("firstvisiblebar");
Plot( 100 * ( C - C[ fvb ] ) / C[ fvb ], Name(), colorBlue );
for( i = 0; ( symbol = StrExtract( TickerList, i ) ) != ""; i++ )
{
fc = Foreign( symbol, "C" );

if( ! IsNull( fc[ 0 ] ) )
{
  Plot( 100 * ( fc - fc[ fvb ] )/ fc[ fvb ], symbol, colorLightOrange + ( (2*i) % 15 ), styleLine );
}
}
PlotGrid( 0, colorYellow );
_N( Title = "{{NAME}} - Relative Performance [%]: {{VALUES}}" );

 

Wäre aber nett wenn Du uns auf dem laufenden hälst

"foreign" kann man nach meinen Versuchen nur einmal anwenden,

 

War grade auf dem Yahoo Groups.

 

Keine Ahnung was er will oder was er für Probleme hat,

steht aber zumindest mehre male das Foreign

 

Sorry, I forgot to say what it is I'm trying to do.

 

I would like to be able to display on the same pane, a number of indicators that might show divergences, by showing the following ratios:

- the SP-500 and the Russel 2000

- the SP-100 and the SP-600

- the Russel 1000 and the Russel 2000

 

I have the following code, but it overlays the plots on top of one another. Using separate panes would mean that I would need to use four separate AFLs - not a problem, but not so clean as having everything together:

 

SPX = Foreign("SP-500", "C");

RUT_SPX = Foreign("RUT-X", "C")/Foreign("SP-500","C");

OEX_SML = Foreign("OEX", "C")/Foreign("SML--X","C");

RUI_RUT = Foreign("RUI-X", "C")/Foreign("RUT-X","C");

 

Plot( SPX, "SPX", colorWhite );

Plot( RUT_SPX, "RUT-SPX", colorBrightGreen, styleLine | styleOwnScale );

Plot( OEX_SML, "OEX-SML", colorOrange, styleLine | styleOwnScale );

Plot( RUI_RUT, "RUI-RUT", colorLightBlue, styleLine | styleOwnScale );

  • 1 year later...

@TolliMolli, ist zwar schon lange her, aber mit AddtoComposite() wäre das möglich.

http://www.amibroker.com/guide/afl/afl_view.php?addtocomposite

http://www.amibroker.com/guide/a_addtocomposite.html

http://www.amibroker.org/3rdparty/IntroToAtc.pdf

 

Beispiel

weight = 10; // default weight

if( Name() == "MSFT" ) weight = 20;
if( Name() == "AAPL" ) weight = 5;
if( Name() == "INTC" ) weight = 15;

/// and so on.

AddToComposite( weight * Close, "~MyComposite", "X" );
Plot ( Foreign("~MyComposite", "X"), "MyComposite", 6, 1);

 

http://www.wisestocktrader.com/indicators/119-weighted-index

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.