Gaussian moving average afl


Wiele mówi o twojej etyce, że nie odczuwasz potrzeby uznania oryginalnego kodera tej AFL. Jednak ta konkretna implementacja ALMA w programie amibroker nie jest dokładna. Prawidłowe, dokładne wdrożenie ALMA zgodnie z wydaniami Ninja Trader i Meta Trader przez oryginalnych twórców ALMA, tj. Arnaud amp Legoux, zostało przesłane przeze mnie, aby użytkownicy amibrokera również mogli z nich korzystać. tylko jedno słowo, to fantastyczne ALMA może być kodowana przy użyciu funkcji FIR. Przez przypadek wpadłem na to pismo: które nie wydaje się wyskakiwać, gdy spojrzysz w instrukcji. FIR pozwala na splatanie tablicy wejściowej z mniejszą funkcją, jak funkcja typu okna Gaussa. kod wynikowy: windowSizeParam (8220Window Size8221,9,5,201,2) sigmaParam (8220Sigma 8221,6,1,20) OffsetParam (8220Offset8221,0.85,0.05,1.0,0.05) funkcja ALMAAFL (input, range, Offset, sigma) local m, im, s, Coeff mfloor (Offset (range-1)) srangesigma SetChartOptions (0, chartShowDates) Wykres (C, 8220Close8221, colorLightGrey, styleCandle) Wykres (rr, quotquot, colorBlue, 1) w rzeczywistości można go zaprogramować za pomocą: wsParam (8220 Rozmiar okna 8221,9,5,201,2) sigmaParam (8220Sigma8221, 6, 1, 20,1) OffsetParam (8220Offset8221,0.85,0,1.0,0.05) biBarIndex () mfloor (Offset (ws-1)) swssigma windowIIf (biltws , (Cum (1) -1) - m, 0) windowIIf (biltws, exp (- (window2) (2s2)), 0) rr FIR (C, window, ws) SetChartOptions (0, chartShowDates) Wykres (C, 8220Close8221, colorLightGrey, styleCandle) Działka (rr, 8220 ALMA 8221, colorBlue, 1) Średnia ruchoma Arnaud Legoux - ALMA Dołączony obraz (kliknij, aby powiększyć) Mam na myśli - jest na otwartym pasku, tak, więc może być używana tylko w celach informacyjnych . MTF kontynuuje malowanie. Może być dobrze mieć wersję z tym wskaźnikiem (ALMAv1 SW) z paskiem 1 (zamknięty pasek). Histo w zamkniętym barze. W tym przypadku - możemy go użyć do handlu - w każdym przedziale czasu z paskiem 1 (domyślnie w ustawieniach 1). Poza tym może być dobrze mieć pewne informacje na temat wykresu na temat ram czasowych. W tym przypadku - jeśli wiele wskaźników jest dołączonych do tego samego okna podrzędnego, dzięki czemu możemy wiedzieć, w którym przedziale czasowym znajduje się np. Histo. Szablon do tego wykresu jest dołączony. Wskaźniki Biblioteka funkcji do filtrowania i wyszukiwania informacji o krzywych cenowych, od tradycyjnej analizy technicznej do bardziej zaawansowanej transformacji i funkcji statystycznych: średnie ruchome, oscylatory, pasma, pęd, wskaźniki wytrzymałości, regresja liniowa, Hilbert transformuje, wskaźniki Ehlersa i analizę spektralną. Wskaźniki są wymienione w kolejności alfabetycznej. Tradycyjne wskaźniki wykorzystują bibliotekę wskaźników TA-Lib autorstwa Mario Fortiera (ta-lib. org), która stała się standardem. Informacje na temat użycia, algorytmów i kodu źródłowego wskaźników TA-Lib można znaleźć na stronie internetowej tadoc. org. Źródło znajduje się również w folderze ZorroSource. Kod źródłowy większości innych wskaźników i funkcji analizy można znaleźć w Zorroincludeindicators. c. Filtry spektralne i funkcje analizy amplitudowej są wymienione w bibliotece widmowej. Klasyczne wzorce świec można znaleźć w bibliotece wzorów. AC (vars Data): var Accelerator Oscillator różnicę wskaźnika AO (patrz poniżej) i jego 5-barowej prostej średniej ruchomej (SMA). Uważa się, że wskazuje przyspieszenie i spowolnienie rynkowej siły napędowej (cokolwiek to znaczy). W przypadku danych zwykle używana jest cena medPrice lub seria cen. Kod źródłowy w indicators. c. ADO (): var AccumulationDistribution Oscillator: ((Close-Low) - (High-Close)) (High-Low). Zakres od -1, gdy zamknięcie jest najniższym taktem, do 1, gdy jest wysoki. Ma na celu zmierzenie podaży i popytu poprzez ustalenie, czy handlowcy generalnie gromadzą (kupują) lub dystrybuują (sprzedają). Wskaźnik ten został opublikowany w wielu poszczególnych wariantach do formuły, ale żaden z nich nie wydaje się lepszy od drugiego. Używa bieżącej serii cen aktywów. Kod źródłowy w indicators. c. ADX (int TimePeriod): var Średni ruch kierunkowy. Średnia ruchoma wskaźnika DX (patrz poniżej). Używa bieżącej serii cen aktywów. Nie obsługuje TimeFrame. Zwrócone wartości mieszczą się w zakresie od 0 do 100. ADXR (int TimePeriod): var Average Directional Movement Index Rating. Średnia z obecnych ADX i ADX z barów TimePeriod temu. Używa bieżącej serii cen aktywów. Nie obsługuje TimeFrame. Alligator (vars Data): var Wskaźnik aligatora. Składa się z trzech linii: niebieski SMA (13) opóźniony o 5 barów czerwony: SMA (8) opóźniony o 2 paski zielony: SMA (5). Wskazuje trend spadkowy z liniami w kolejności niebiesko-czerwono-zielonej (od góry do dołu) i trend wzrostowy z zielono-czerwono-niebieskim. Im bliżej linii Alligatorrsquos, tym słabszy trend i vice versa. Nie zawiera dodatkowych 3 pasków opóźnienia w stosunku do oryginalnego algorytmu aligatora (użyj do tego Data3). Dla danych zwykle używana jest średnia wartość highlow (seria MedPrice). Wynik w rRed. rGreen. rBlue. Kod źródłowy w indicators. c. ALMA (vars Data, int TimePeriod, int Sigma, var Offset): var ALMA (vars Data, int TimePeriod): var Arnaud Legoux Średnia ruchoma. W oparciu o rozkład Gaussa z tendencją do początku serii danych (tj. Nowsze ceny). Parametry: Sigma (szerokość rozkładu, domyślnie 6) Przesunięcie (współczynnik odchylenia, domyślnie 0,85). Kod źródłowy w indicators. c. AO (vars Data): var Awesome Oscillator to po prostu różnica 5-barowego i 34-barowego SMA. W przypadku danych zwykle używana jest cena medPrice lub seria cen. Kod źródłowy w indicators. c. APO (vars Data, int FastPeriod, int SlowPeriod, int MAType): var Absolute Price Oscillator to bardziej ogólna wersja AO. Zwraca różnicę między dwiema ruchomymi średnimi. Parametry: FastPeriod (Liczba okresów dla szybkiego MA), Wolny czas (Liczba okresów dla wolnego MA), Typ MAT (typ średniej ruchomej). Aroon (int TimePeriod): var Aroon indicator. Składa się z dwóch linii (w górę i w dół), które mierzą czas, jaki upłynął od momentu, gdy najwyższy wysoki poziom niski wystąpił w danym okresie. Używa bieżącej serii cen aktywów. Nie obsługuje TimeFrame. Wynik w rAroonDown. rAroonUp. AroonOsc (int TimePeriod): var Aroon Oscillator. Obliczono przez odjęcie Aroon Down od Aroon Up. Wartość zwracana oscyluje między 100 a -100. Używa bieżącej serii cen aktywów. Nie obsługuje TimeFrame. ATR (int TimePeriod): var Average True Range. Miara zmienności cen, przydatna do obliczenia utraty stopu lub odległości celu zysku. Wzór: ATR (ATR1 (TimePeriod-1) max (wysoki, zamknięty) - min (niski, zamknięty)) TimePeriod. gdzie ATR1 to ATR z ostatniego paska. Korzysta z bieżących cen aktywów. Funkcja wewnętrznie tworzy serie, gdy TimeFrame to gt 1. i musi zostać wywołana w ustalonej kolejności w skrypcie. Zobacz także: Zmienność. CVolatilty. TrueRange. ATRS. ATR (vars Open, vars High, vars Low, vars Close, int TimePeriod): var Średni zakres rzeczywisty z dowolnych szeregów cenowych, z dowolnym przesunięciem i ramą czasową. ATRS (int TimePeriod): var Simple Average True Range. SMA w TrueRange w czasie TimePeriod. przy użyciu serii aktualnych cen aktywów. Miara zmienności cen, łatwiejsza do obliczenia niż ATR. ale dostosowuje się powoli do zmian zmienności, a tym samym mniej nadaje się do celów stop loss profit. Używany przez platformę MT4 zamiast prawdziwego ATR. Nie obsługuje TimeFrame. Kod źródłowy w indicators. c. AvgPrice (): var Średnia cena. Po prostu (OpenHighLowClose) 4 w bieżącej serii cen aktywów. BBands (vars Data, int TimePeriod, var NbDevUp, var NbDevDn, int MAType) Bollinger Bands. Składający się z trzech linii środkowy pas jest prostą średnią kroczącą (zazwyczaj 20 okresów) typowej ceny (TP). Górne i dolne pasma są odchyleniami standardowymi (zazwyczaj 2) powyżej i poniżej środkowego pasma. Pasma rozszerzają się i zawężają, gdy zmienność ceny jest odpowiednio wyższa lub niższa. Zespoły Bollingera wskazują, kiedy cena stała się względnie wysoka lub niska, co jest sygnalizowane przez dotyk lub mniejszą penetrację górnej lub dolnej linii. Wynik w rRealUpperBand. rRealMiddleBand. rRealLowerBand. Parametry: NbDevUp (mnożnik odchylenia dla górnego pasma), NbDevDn (mnożnik odchylenia dla dolnego pasma), MAType (typ średniej kroczącej). Przykład w Indexatortest. c. BBOsc (vars Data, int TimePeriod, var NbDev, int MAType): var Bollinger Bands Oscillator Procent aktualnej wartości serii w obrębie pasm Bollingera. Beta (vars Data, vars Data2, int TimePeriod): var Wartość beta. Miara pojedynczych cen aktywów względem ogólnego indeksu rynkowego. Cena aktywów podana jest w danych, a ceny rynkowe w danych 2. Algorytm oblicza zmianę między cenami w obu seriach, a następnie kreśli te zmiany jako punkty w płaszczyźnie euklidesowej. Wartość x dowolnego punktu to zmiana Data2 (rynek), a wartość y to zmiana danych (aktywów). Wartość beta jest nachyleniem liniowej linii regresji przez te punkty. Beta 1 to prosta linia yx, więc zasób jest różny w zależności od rynku. Wartość beta wynosząca mniej niż jeden oznacza, że ​​aktywa różnią się mniej niż rynek, a współczynnik beta więcej niż jeden oznacza, że ​​aktywa różnią się bardziej niż rynek. BOP (): var Balans mocy po prostu (Close - Open) (High - Low). Używa bieżącej serii cen aktywów. CCI (int TimePeriod): var Indeks kanału towarowego. Zmienność ceny ze średniej statystycznej zwykle oscyluje pomiędzy -100. Używa bieżącej serii cen aktywów. Nie obsługuje TimeFrame. CI (int TimePeriod): var Wskaźnik chrupkości mierzy zmienność pojedynczego pręta w stosunku do zmienności poprzedniego okresu czasu w zakresie 1,100. Używa bieżącej serii cen aktywów. Nie obsługuje TimeFrame. ChandelierLong (int TimePeriod, var Multiplier): var ChandelierShort (int TimePeriod, var Multiplier): var Żyrandol wychodzi z najwyższej ceny okresu Czasu, pomniejszonej o ATR pomnożony przez Mnożnik. Zwykle stosowany jako trailing Stop Loss. za utrzymywanie transakcji w trendach i zapobieganie wczesnemu wycofywaniu się, o ile tendencja będzie się utrzymywać. Kod źródłowy w indicators. c. Nie obsługuje TimeFrame. Przykład w rozdziale TMF. CGOsc (vars Data, int TimePeriod): var Oscylator Center of Gravity, John Ehlers oblicza odchylenie cen od ich centrum w ramach TimePeriod. Może być używany do określania punktów zwrotnych ceny przy prawie zerowym opóźnieniu. Kod źródłowy w indicators. c. Chikou (int Shift): var Chikou line należący do wskaźnika Ichimoku, po prostu Shift przesunięty do przodu o Shift (opcjonalnie domyślnie 26). Używa bieżącej serii cen aktywów. Kod źródłowy w indicators. c. CMO (vars Data, int TimePeriod): var Chande Momentum Oscillator. Podobne do RSI. ale dzieli całkowity ruch danych przez ruch sieciowy ((góra - dół) (góra dół)). Coral (vars Data): var Coral Indicator, po prostu T3 z TimePeriod 60 i VolumeFactor 0.4. Korelacja (vars Data1, vars Data2, int TimePeriod): var Współczynnik korelacji Pearsonsa między dwiema seriami danych w danym okresie TimePeriod. w przedziale od -1..1. Współczynnik 1,0, korzystna dodatnia korelacja, oznacza, że ​​zmiany w Danych2 powodują identyczne zmiany w Danych1 (np. Zmiana wskaźnika spowoduje identyczną zmianę ceny aktywów). Współczynnik -1,0, odpowiednia korelacja ujemna, oznacza, że ​​zmiany w Data2 powodują identyczne zmiany w Data1. ale w przeciwnym kierunku. Współczynnik zerowy oznacza brak związku między dwiema seriami i że zmiana w Data2 nie będzie miała wpływu na Dane1. Funkcja ta może być również użyta do uzyskania autokorelacji szeregu przez obliczenie współczynnika korelacji między serią oryginalną i tą samą serią opóźnioną o jeden lub dwa takty (seria 1 lub seria 2). Kowariancja (vars Data1, vars Data2, int TimePeriod): var Kowariancja między dwiema seriami danych. Może być użyty do wygenerowania macierzy kowariancji f. i. do obliczenia markowitza efektywnej granicy. DChannel (int TimePeriod) Donchian Kanał minimalnej i maksymalnej wartości funkcji HIGH () i cenowej w danym okresie. Podstawa słynnego systemu handlu turtle. Używa bieżącej serii cen aktywów. Nie obsługuje TimeFrame. Wynik w rRealUpperBand. rRealLowerBand. DCOsc (vars Data, int TimePeriod): var Oscylator kanału Donchiana Procent aktualnej wartości danych w kanale Donchian. Używa bieżącego zasobu i bieżącej ramki czasowej. Decycle (vars Data, int CutOffPeriod): var Ehlers Decycler, wskaźnik trendu niskiego opóźnienia po prostu Dane - HighPass2 (Data, CutOffPeriod). Usuwa wszystkie cykle poniżej CutOffPeriod z serii danych i utrzymuje trend. Funkcja wewnętrznie tworzy serie i dlatego musi być wywoływana w ustalonej kolejności w skrypcie. Kod źródłowy w indicators. c. DEMA (vars Data, int TimePeriod): var Double Exponential Moving Average. DPO (vars Data, int TimePeriod): var Detrended Price Oscillator uważał, że wykrywa wczesne zmiany w kierunku cen. DPO Data0 - SMA (Datan21, n). gdzie n to Okres Czasu. Kod źródłowy w indicators. c. DX (int TimePeriod): var Directional Movement Index autorstwa Wellesa Wildera (który, nawiasem mówiąc, odkrył, że wzajemne oddziaływanie słońca, księżyca i ziemi jest podstawą wszystkich ruchów rynkowych, w przypadku gdy słońce, księżyc i ziemia nagle powstrzymają się z przeniesienia rynku wymyślił także kilka tradycyjnych wskaźników). Uważa się, że DX wskazuje siłę trendu. Wartości mieszczą się w zakresie od 0 do 100, ale rzadko przekraczają 60. DX używa bieżącej serii cen aktywów i nie obsługuje funkcji TimeFrame. Wzór: DX 100 abs (PlusDI-MinusDI) (PlusDIMinusDI). W przypadku PlusDI i MinusDI patrz opis poniżej. EMA (vars Data, int TimePeriod): var EMA (vars Data, var alpha): var Exponential Moving Average. Podkreśla nowsze wartości danych. Używa wzoru EMA alfa danych (1-alfa) EMA1. gdzie alfa jest współczynnikiem rekurencji między 0. 1, który jest obliczany od 2,0 (TimePeriod1). a EMA1 jest poprzednią wartością EMA. Im mniejsza jest wartość alfa, tym wyższy jest efekt wygładzania formuły EMA. Obie funkcje EMA wykorzystują nieco inne algorytmy. Pierwsza (przy użyciu TimePeriod) nie tworzy serii, jest wolniejsza i wymaga długości danych TimePeriodUnstablePeriod 1. Drugi (przy użyciu alfa) tworzy wewnętrzną serię, potrzebuje tylko danych o długości 2 i jest znacznie szybszy. Fisher (vars Data): var Transformer Fishera przekształca znormalizowaną serię danych w normalny rozproszony zakres. Wartość zwracana nie ma teoretycznego limitu, ale większość wartości ma wartość od -1. 1. Wszystkie wartości danych muszą mieć wartość -1. 1 zakres, f. i. przez normalizowanie z AGC. Normalizuj. lub funkcja cdf. Minimalna długość danych wynosi 1. Źródło dostępne w indicators. c. FisherInv (vars Data): var Inverse Fisher Transform kompresuje serie danych w zakresie od -1 do 1. Minimalna długość serii danych wynosi 1. Źródło dostępne w indicators. c. FisherN (vars Data, int TimePeriod): var Fisher Transform z normalizacją normalizuje serię danych z danym TimePeriod, a następnie przekształca ją w normalny rozproszony zakres. Podobnie jak w filtrze znormalizowanym (patrz poniżej), ale bardziej selektywnym ze względu na normalny rozkład wyników. Wartość zwracana nie ma teoretycznego limitu, ale większość wartości znajduje się w -1,5. Zakres 1,5. Minimalna długość serii danych jest równa TimePeriod. Funkcja wewnętrznie tworzy serie i dlatego musi być wywoływana w ustalonej kolejności w skrypcie. Źródło dostępne w indicators. c. FractalDimension (vars Data, int TimePeriod): var Fraktalny wymiar serii danych, autor John Ehlers normalnie 1..2. Mniejsze wartości oznaczają więcej marszczenia. Może być używany do wykrywania obecnego reżimu rynkowego lub do dostosowywania średnich kroczących do wahań szeregu cenowego. Źródło dostępne w indicators. c. FractalHigh (vars Data, int TimePeriod): var Fractal High, wskaźnik według Billa Williamsa, uważał za sygnał, kiedy rynek się odwraca (nie ma nic wspólnego z fraktalami). Zwraca najwyższą wartość danych, gdy znajduje się pośrodku okresu czasu. w przeciwnym razie 0. FractalLow (vars Data, int TimePeriod): var Fractal Low. Zwraca najniższą wartość danych, gdy znajduje się pośrodku okresu czasu. w przeciwnym razie 0. Gauss (vars Data, int TimePeriod): var Gauss Filter, zwraca średnią ważoną danych w danym okresie czasu, z krzywą wagową równą rozkładowi normalnemu Gaussa. Przydatny do usuwania szumów poprzez wygładzanie nieprzetworzonych danych. Minimalna długość serii danych jest równa TimePeriod. opóźnienie wynosi połowę Okresu Czasu. HAOpen (): var HAClose (): var HAHigh (): var HALow (): var Ceny Haiken Ashi, na podstawie aktualnych cen aktywów. Kod źródłowy w indicators. c. Alternatywnie, krzywą ceny można przekonwertować na paski Haiken Ashi za pomocą funkcji paska. HH (int TimePeriod, int Offset): var Najwyższa wartość funkcji priceHigh w stosunku do TimePeriod kończącej się Offset (domyślnie 0). F. i. HH (3) zwraca najwyższą cenę z ostatnich 3 pasków. Używa bieżącej serii danych o aktywach. Nie obsługuje TimeFrame dla wielu ramek czasowych, zamiast tego użyj MaxVal (HighOffset, Period) z synchronizowaną w czasie serią High. Zobacz także DayHigh. HMA (vars Data, int TimePeriod): Zmienna średnia ruchów kadłuba autorstwa Alana Hulla próbuje zająć się opóźnieniem, a także wyrównać nieco chropowatość. Wzór: HMA (n) WMA (2WMA (n2) ndash WMA (n)), sqrt (n)). Funkcja wewnętrznie tworzy serię i dlatego musi być wywoływana w ustalonej kolejności w skrypcie. Kod źródłowy w indicators. c. HTDcPeriod (vars Data): var Hilbert Transform - Dominant Cycle Period, opracowany przez Johna Ehlersa. Algorytmy transformacji Hilberta są wyjaśnione w książce Ehlers quotRocket Science for Tradersquot (patrz lista książek). Ta funkcja jest równoważna, ale mniej dokładna niż funkcja DominantPeriod. HTDcPhase (vars Data): var Hilbert Transform - Faza cyklu dominującego. HTPhasor (vars Data): var Hilbert Transform - Phasor Components. Wynik w rInPhase. rQuadrature. HTSine (vars Data): var Hilbert Transform - SineWave. Wynik w rSine. rLeades. HTTrendline (vars Data): var Hilbert Transform - Instantaneous Trendline. HTTrendMode (vars Data): int Wskaźnik trendu Hilbert Transform - zwraca 1 dla trybu trendu, 0 dla trybu cyklu. Hurst (vars Data, int TimePeriod): var Hurst wykładnik z serii danych od 0..1. Wykładnik Hursta mierzy pamięć serii. Określa ilościowo autokorelację, tj. Tendencję do powrotu do średniej (Hurst 0.5) lub do kontynuowania trendowania w kierunku (Hurst gt 0,5). W ten sposób wykładnik Hursta może wykryć, czy rynek jest w stanie trendu. Okno TimePeriod (minimum 20) musi mieć długość wystarczającą do wychwycenia długoterminowego trendu. Funkcja wewnętrznie tworzy serię i dlatego musi być wywoływana w ustalonej kolejności w skrypcie. Źródło dostępne w indicators. c. Ichimoku () Ichimoku (int PeriodTenkan, int PeriodKijun, int PeriodSenkou, int Offset) Wskaźnik Ichimoku Kinko Hyo. Wymyślona przez dziennikarza Goichi Hosoda w 1930 roku. Mieszanka średnich cen w 3 okresach czasu uważana za zapewniającą głęboki wgląd w trendy rynkowe dzięki ogromnej liczbie kolorowych linii. Przesunięcie (domyślnie 0) określa pasek do obliczania wskaźnika. Zwraca 4 zmienne: Kolejną linią należącą do linii Ichimoku, Chikou, jest przyszłe szczypanie i obliczane osobno. Używa bieżącej serii cen aktywów. Funkcja wewnętrznie tworzy serie, gdy TimeFrame to gt 1. i musi zostać wywołana w ustalonej kolejności w skrypcie. Kod źródłowy w indicators. c. IBS (): var Siła wewnętrznego słupka po prostu (Close - Low) (High - Low). Używa bieżącej serii cen aktywów. KAMA (vars Data, int TimePeriod): var Kaufman Adaptive Moving Average. Wykładnicza średnia ruchoma skorygowana o zmienność cen, więc jej okres czasu staje się krótszy, gdy zmienność jest wysoka. Keltner (vars Data, int TimePeriod, var Factor): var Keltner Channel, Charles Keltner. Prosta średnia ruchoma - SMA (Data, TimePeriod) - z bocznymi pasmami w odległości Factor ATRS (TimePeriod). Wyniki w rRealUpperBand. rRealMiddleBand. rRealLowerBand. Kod źródłowy w indicators. c. Laguerre (vars Data, var alpha): var 4-elementowy filtr Laguerre. Służy do wygładzania danych podobnych do EMA. ale z mniejszym opóźnieniem i szerokim zakresem strojenia określonym przez współczynnik wygładzania alfa (0..1). Komponenty niskiej częstotliwości są opóźnione o wiele bardziej niż komponenty o wysokiej częstotliwości, co umożliwia bardzo gładkie filtry z niewielką ilością danych. Minimalna długość serii danych wynosi 1, minimalny okres obserwacji wynosi 4. Funkcja wewnętrznie tworzy serie i dlatego musi być wywołana w ustalonej kolejności w skrypcie. Źródło dostępne w indicators. c. LinearReg (vars Data, int TimePeriod): var Regresja liniowa, określana również jako metoda najmniejszych kwadratów lub pasujący do zapytania. Regresja liniowa próbuje dopasować prostą linię trendu między kilkoma punktami danych w taki sposób, aby odległość między każdym punktem danych a linia trendu jest zminimalizowana. Dla każdego punktu linia prosta powyżej określonego poprzedniego okresu pręta jest określana jako yb mx. Funkcja LinearReg zwraca bm (TimePeriod-1). Aby uzyskać regres wyższego rzędu, użyj funkcji polyfit polynom. W przypadku regresji logistycznej z wieloma zmiennymi użyj funkcji doradczej (PERCEPTRON.). LinearRegAngle (vars Data, int TimePeriod): var Linear Regression Angle. Zwraca m przeliczone na stopnie. Ze względu na różne jednostki x i y wykresu cenowego kąt jest zwykle mało przydatny, może z wyjątkiem obserwatorów Gann. LinearRegIntercept (vars Data, int TimePeriod): var Linear Regression Intercept. Zwraca b. LinearRegSlope (vars Data, int TimePeriod): var Linear Regression Slope. Zwraca m jako różnica w cenie na pasek. LL (int TimePeriod, int Offset): var Najniższa wartość funkcji priceLow w okresie TimePeriod kończącym się Offset (domyślnie 0). F. i. LL (3,10) zwraca najniższą cenę między ostatnimi 10 a ostatnimi 13 słupkami. Używa bieżącej serii cen aktywów. Nie obsługuje TimeFrame dla wielu ramek czasowych, należy użyć MinVal (LowOffset, Period) z synchronizowaną w czasie serią Low. Zobacz także dayLow. MACD (vars Data, int FastPeriod, int SlowPeriod, int SignalPeriod) Moving Average ConvergenceDivergence. MACD jest pośrednim wskaźnikiem trendu, utworzonym przez odjęcie 26-okresowej wykładniczej średniej ruchomej (EMA, patrz wyżej) z 12-okresowej EMA. Dziewięcio-okresowa EMA jest następnie stosowana do wyniku MACD w celu utworzenia linii sygnałowej. Linię histogramu MACD tworzy się ostatecznie z różnicy MACD do linii sygnałowej. Uważa się, że przejście przez zero histogramu od dołu jest sygnałem kupna, zero przekraczania z góry sygnału sprzedaży. Wzór: rMACD EMA (dane, FastPeriod) - EMA (dane, okres wolny) rMACDSignal EMA (rMACD, SignalPeriod) rMACDHist rMACD - rMACDSignal Wyniki w rMACD. rMACDSignal. rMACDHist. Zwraca: rMACD. Parametry: FastPeriod (okres czasu dla szybkiego MA), SlowPeriod (okres czasu dla wolnego MA), SignalPeriod (okres czasu dla wygładzenia linii sygnałowej). MACDExt (vars Data, int FastPeriod, int FastMAType, int SlowPeriod, int SlowMAType, int SignalPeriod, int SignalMAType) MACD z kontrolowanym typem MA. Wynik w rMACD. rMACDSignal. rMACDHist. Parametry: FastPeriod (okres czasu dla szybkiego MA), FastMAType (typ średniej ruchomej dla szybkiego MA), SlowPeriod (okres czasu dla wolnego MA), SlowMAType (typ średniej ruchomej dla wolnego MA), SignalPeriod (okres czasu dla wygładzania) linia sygnału), SignalMAType (Typ średniej ruchomej dla linii sygnałowej). MACDFix (vars Data, int SignalPeriod) Średnia ruchoma ConvergenceDivergence Fix 1226. Wynik w rMACD. rMACDSignal. rMACDHist. Parametry: SignalPeriod (okres czasu na wygładzenie linii sygnałowej). MAMA (vars Data, var FastLimit, var SlowLimit) MESA Adaptive Moving Average, opracowany przez Johna Ehlersa (patrz linki). Wynik w rMAMA. rFAMA. Parametry: FastLimit (użycie górnego ograniczenia w algorytmie adaptacyjnym), SlowLimit (użycie dolnego limitu w algorytmie adaptacyjnym). MaxVal (vars Data, int TimePeriod): var Najwyższa wartość w określonym okresie. MaxIndex (vars Data, int TimePeriod): int Indeks najwyższej wartości w określonym okresie. 0 najwyższa wartość jest na bieżącym pasku, 1 na jeden słupek temu i tak dalej. Mediana (vars Data, int TimePeriod): var Median Filter sortuje elementy serii danych i zwraca ich średnią wartość w danym okresie czasu. Przydatny do usuwania skoków szumów poprzez eliminację ekstremalnych wartości. Minimalna długość serii danych jest równa TimePeriod. opóźnienie wynosi połowę Okresu Czasu. Zobacz także Percentyl. MedPrice (): var Cena centrum po prostu punkt środkowy (HighLow) 2 aktualnej świecy. Za średnią cenę - średnią z wszystkich ticketów świecy - użyj ceny (). MidPoint (vars Data, int TimePeriod): var MidPoint over period. Po prostu (najwyższa wartość najniższa wartość) 2. MidPrice (int TimePeriod): var Średnia cena w danym okresie. Po prostu (najwyższy najwyższy najniższy poziom niski) 2 bieżącej serii cen aktywów. Nie obsługuje TimeFrame. MinusDI (int TimePeriod): var MinusDI (vars Open, vars High, vars Low, vars Close, int TimePeriod): var Minus Directional Indicator, część wskaźnika DX. Jeśli funkcja nie jest wywoływana w różnych seriach cenowych, używana jest seria cen aktywów bieżących. MinusDM (int TimePeriod): var MinusDM (vars Open, vars High, vars Low, vars Close, int TimePeriod): var Minus Directional Movement, dwie wersje. Jeśli funkcja nie jest wywoływana w różnych seriach cenowych, używana jest seria cen aktywów bieżących. MinVal (vars Data, int TimePeriod): var Najniższa wartość w określonym okresie. MinIndex (vars Data, int TimePeriod): int Indeks najniższej wartości w określonym okresie. 0 najniższa wartość jest na bieżącym pasku, 1 na jeden pasek temu i tak dalej. MinMax (vars Data, int TimePeriod): var Najniższe i najwyższe wartości oraz ich indeksy w określonym okresie. Wynik w rMin. rMax. rMinIdx. rMaxIdx. MinMaxIndex (vars Data, int TimePeriod): int Indeksy najniższych i najwyższych wartości w określonym okresie. Wynik w rMinIdx. rMaxIdx. 0 bieżący pasek, 1 jeden pasek temu i tak dalej. MMI (vars Data, int TimePeriod): var Wskaźnik średniej rynkowej według Financial Hacker. Mierzy średnią rynkową, tj. Średnią tendencję zwrotną, w zakresie 0,100. Liczby losowe mają MMI równy 75. Rzeczywiste ceny są mniej więcej autokorelowane, więc prawdopodobieństwo, że realne szeregi cenowe powrócą do średniej, jest mniejsze niż 75, ale zwykle wynosi więcej niż 50. Im wyższa wartość, tym większy jest rynek . Indeks średniej rynkowej może określić, kiedy kolejne systemy staną się bardziej rentowne (MMI spada) lub mniej zyskowne (MMI rośnie), a tym samym zapobiegać stratom w nierentownych okresach. Kod źródłowy w indicators. c. Mama (vars Data, int TimePeriod): var Momentum. Po prostu Data0 - DataTimePeriod. Zobacz także diff. Moment (vars Data, int TimePeriod, int N): var Statystyczny moment N (1..4) sekcji Serii danych podany przez TimePeriod. Pierwsza chwila to średnia, druga to wariancja, trzecia to skośność, a czwarta to kurtoza. Źródło dostępne w indicators. c. MovingAverage (vars Data, int TimePeriod, int MAType): var Średnia ruchoma. Parametry: MAType (typ średniej ruchomej, patrz uwagi). MovingAverageVariablePeriod (vars Data, vars Periods, int MinPeriod, int MaxPeriod, int MAType): var Średnia ruchoma ze zmiennym okresem podana w serii Periods. Parametry: MinPeriod (Wartość mniejsza niż minimalna zostanie zmieniona na Minimalny), MaxPeriod (Wartość wyższa niż maksymalna zostanie zmieniona na Maksymalny okres), MAType (Typ ruchomej średniej, patrz uwagi). NATR (int TimePeriod): var Normalized Average True Range, autor: John Forman. Podobne do ATR, z wyjątkiem tego, że jest znormalizowany w następujący sposób: NATR 100 ATR (TimePeriod) Close. Używa bieżącej serii cen aktywów. Nie obsługuje TimeFrame. Normalizuj (vars Data, int TimePeriod): var Przekształca serię danych w wartość -1. 1 zakres w danym Okresie Czasu. Podobnie do funkcji AGC, ale nie rozróżnia między atakiem a rozpadem. Minimalna długość serii danych jest równa TimePeriod. Źródło dostępne w indicators. c. Patrz także scale. NumInRange (vars Low, vars High, var Min, var Max, int Length): var Liczba zakresów danych, podanych przez ich wartości Niskie i Wysokie, które leżą całkowicie wewnątrz przedziału od Min. Do Maksimum w podanej Długości. Może być stosowany do obliczania rozkładu cen lub świec. Wartości Low i High można ustawić na taką samą wartość, aby zliczyć wszystkie wartości w przedziale lub zamienione w celu zliczenia wszystkich świec, które dotykają interwału. Zakres 1. Czas Okres. Źródło dostępne w indicators. c. NumRiseFall (vars Data, int TimePeriod): var Długość bieżącej sekwencji rosnących lub opadających wartości w tablicy Dane, z powrotem do danego TimePeriod. Dla wznoszącej się sekwencji jego długość jest zwracana, dla sekwencji opadającej długość ujemna. Zasięg 1..TimePeriod resp. -1 ..- TimePeriod. Źródło dostępne w indicators. c. Zobacz przykładowy skrypt RandomWalk i rozdział Strategia. Źródło dostępne w indicators. c. NumWhiteBlack (var Body, int Offset, int TimePeriod): var Liczba białych minus czarnych świec w danym Okresie Czasu. Przesunięcie to odległość do bieżącego pręta (pręt 0 prądu), Ciało jest minimalną długością świecy, która ma zostać policzona. Źródło dostępne w indicators. c. Percentyl (vars Data, int Length, var Percent): var Zwraca dany percentyl z serii danych o zadanej długości f. i. Procent 95 zwraca wartość danych powyżej 95 wszystkich pozostałych wartości. Procent 50 zwraca medianę serii danych. Aby obliczyć procent danej wartości percentyla, użyj funkcji NumInRange i policz elementy poniżej percentyla. PlusDI (int TimePeriod): var PlusDI (vars Open, vars High, vars Low, vars Close, int TimePeriod): var Plus Directional Indicator, część DX indicato, dwie wersje. W pierwszej wersji używana jest bieżąca seria cen aktywów. PlusDM (int TimePeriod): var PlusDM (vars Open, vars High, vars Low, vars Close, int TimePeriod): var Plus Directional Movement, dwie wersje. W pierwszej wersji używana jest bieżąca seria cen aktywów. PPO (vars Data, int FastPeriod, int SlowPeriod, int MAType): var Percentage Price Oscillator. Parametry: FastPeriod (Liczba okresów dla szybkiego MA), Wolny czas (Liczba okresów dla wolnego MA), Typ MAT (typ średniej ruchomej). ProfitFactor (vars Data, int Length): var Zwraca współczynnik zysku z serii danych. Współczynnik zysku jest to stosunek sumy dodatnich zwrotów (tj. Datai-1 gt Datai) do sumy ujemnych zwrotów (tj. Datai-1 lt Datai). Zwrócona wartość zostaje obcięta do 0,1. 10 zakres. Jego odwrotność musi być stosowana, gdy tablica danych nie jest w porządku szeregowym, ale w porządku chronologicznym, a następnie wygrane i straty są zamieniane. Źródło dostępne w indicators. c. ROC (vars Data, int TimePeriod): var Szybkość zmian, 100 scale: ((price-prevPrice) prevPrice) 100. ROCP (vars Data, int TimePeriod): var Szybkość zmian Procent: (price-prevPrice) prevPrice. Zobacz także diff. ROCR (vars Data, int TimePeriod): var Stopa zmiany stosunku: (priceprevPrice). ROCL (vars Data, int TimePeriod): var Powrót logarytmiczny: log (priceprevPrice). ROCR100 (vars Data, int TimePeriod): var Wskaźnik zmiany współczynnika, 100 scale: (priceprevPrice) 100. Dach (vars Data, int CutoffLow, int CutoffHigh): var Ehlers, filtr dachowy, przygotowuje serię danych do dalszych obliczeń, usuwając trend i hałas. Stosuje 2-biegunowy filtr górnoprzepustowy, a następnie filtr Smooth. Zalecane wartości dla niskich i wysokich czasów odcięcia to 10 i 50. The minimum length of the Data series is 2. The function internally creates series and thus must be called in a fixed order in the script. Source available in indicators. c . RSI(vars Data, int TimePeriod): var Relative Strength Index, by Welles Wilder. Ratio of the recent upwards data movement to the total data movement range 0..100. The RSI is believed to indicate overboughtoversold conditions when the value is over 70below 30. Formula: RSI 100 Up(UpDn) . where Up EMA(max(0,Data0-Data1),TimePeriod) and Dn EMA(max(0,Data1-Data0),TimePeriod) . RVI(int TimePeriod): var Relative Vigor Index, by John Ehlers. Ratio of price change to the total price range: (C-O)(H-L) . averaged over the time period and smoothed with a FIR filter. Oscillates between -1 and 1 . The function internally creates a series and thus must be called in a fixed order in the script. Source code in indicators. c . SAR(var Step, var Min, var Max): var Parabolic SAR, by Welles Wilder. The SAR runs above or below the price curve, depending on the current trend each price curve crossing is believed to indicate a trend change. Parameters: Step (acceleration factor increment, normally 0.02 ), Min (acceleration factor minimum value, normally 0.02 ), Max (acceleration factor maximum value, normally 0.2 ). SAR is a recursive function that depends on the direction of the initial price candle for consistent values the LookBack period should be long enough to contain at least one price curve crossing. Uses the current asset prices. The function internally creates a series and thus must be called in a fixed order in the script. Source code in indicators. c . example in Indicatortest. c . ShannonGain(vars Data, int TimePeriod): var Expected logarithmic gain rate of the Data series in the range of about -0.0005 . The gain rate is derived from the Shannon probability P (1 Mean(Gain) RootMeanSquare(Gain)) 2 . which is the likeliness of a rise or fall of a high entropy data series in the next bar period. A positive gain rate indicates that the series is more likely to rise, a negative gain rate indicates that it is more likely to fall. The zero crossover could be used for a trade signal. Algorithm by John Conover . Source available in indicators. c . ShannonEntropy(vars Data, int Length, int PatternSize): var Entropy of patterns in the Data series, in bit can be used to determine the randomness of the data. PatternSize (2..8) determines the partitioning of the data into patterns of up to 8 bit. Each Data value is either higher than the previous value, or it is not this is a binary information and constitutes one bit of the pattern. The more random the patterns are distributed, the higher is the Shannon entropy. Totally random data has a Shannon entropy identical to the pattern size. Algorithm explained on the Financial Hacker blog source available in indicators. c . SIROC(vars Data, int TimePeriod, int EMAPeriod): var Smoothed Rate of Change (S-RoC) by Fred G Schutzman. Differs from the ROC (see above) in that it is based on the exponential moving average ( EMA ) of the Data series. Believed to indicate the strength of a trend by determining if the trend is accelerating or decelerating. Formula: (Current EMA - Previous EMA)(Previous EMA) x 100. Source code in indicators. c . SMA(vars Data, int TimePeriod): var Simple Moving Average the mean of the data, i. e. the sum divided by the time period. Use Moment when long time periods are required. Smooth(vars Data, int CutoffPeriod): var Ehlers super-smoothing filter, a 2-pole Butterworth filter combined with a SMA that suppresses the Nyquist frequency. Can be used as a low-lag universal filter for removing noise from price data. The minimum length of the Data series is 2. The function internally creates series and thus must be called in a fixed order in the script. Source available in indicators. c . SMom(vars Data, int TimePeriod, int CutoffPeriod): var Smoothed Momentum by John Ehlers indicates the long term trend direction. TimePeriod is the momentum period, CutoffPeriod is a Butterworth filter constant for lowpass filtering the momentum. Source code in indicators. c . Spearman(vars Data, int TimePeriod): var Spearmans rank correlation coefficient correlation between the original Data series and the same series sorted in ascending order within TimePeriod ( 1..256 ). Returns the similarity to a steadily rising series and can be used to determine trend intensity and turning points. Range -1..1 . lag TimePeriod2 . For usage and details, see Stocks amp Commodities magazine 22017. Source available in indicators. c . StdDev(vars Data, int TimePeriod): var Standard Deviation of the Data series in the time period, from the ta-lib . Use the square root of the second Moment when high accuracy or long time periods are required. Stoch(int FastKPeriod, int SlowKPeriod, int SlowKMAType, int SlowDPeriod, int SlowDMAType) Stochastic Oscillator (unrelated to stochastics, but its inventor, George Lane, looked for a fancy name). Measures where the Close price is in relation to the recent trading range. Formula: FastK 100 (Close-LL)(HH-LL) SlowK MA(FastK) SlowD MA(SlowK) . Uses the current asset price series and does not support TimeFrame . Result in rSlowK . rSlowD . Some traders believe that the SlowK crossing above SlowD is a buy signal others believe they should buy when SlowD is below 20 and sell when it is above 80. Parameters: FastKPeriod - Time period for the HH and LL to generate the FastK value, usually 14 . SlowKPeriod - Time period for smoothing FastK to generate rSlowK usually 3 . SlowKMAType - Type of Moving Average for Slow-K, usually MATypeEMA . SlowDPeriod - Time period for smoothing rSlowK to generate rSlowD . usually 3 . SlowDMAType - Type of Moving Average for Slow-D, usually MATypeEMA . StochEhlers(vars Data, int TimePeriod, int CutOffLow, int CutOffHigh): var Predictive stochastic oscillator by John Ehlers. Measures where the Data value is in relation to its range within TimePeriod . The data runs through a 2-pole highpass filter with period CutOffHigh and through a Butterworth lowpass filter with period CutOffLow . Indicator algorithm explained in Ehlers quotPredictive Indicatorsquot paper usage example in the Ehlers script. Source code in indicators. c . The function internally creates series and thus must be called in a fixed order in the script. StochF(int FastKPeriod, int FastDPeriod, int FastDMAType): var Stochastic Fast. Measures where the Close price is in relation to the recent trading range Formula: Fast-K 100 (Close-LL)(HH-LL) Fast-D MA(Fast-K) . Uses the current asset price series. Does not support TimeFrame . Result in rFastK . rFastD . Returns: FastK . Parameters: FastKPeriod (Time period for the HH and LL of Fast-K, usually 14 ), FastDPeriod (Moving Average Period for Fast-D usually 3 ), FastDMAType (Type of Moving Average for Fast-D, usually MATypeEMA ). StochRSI(vars Data, int TimePeriod, int FastKPeriod, int FastDPeriod, int FastDMAType): var Stochastic Relative Strength Index (RSI ). Result in rFastK . rFastD . Returns: FastK . Parameters: FastKPeriod (Time period for building the Fast-K line), FastDPeriod (Smoothing for making the Fast-D line. Usually set to 3), FastDMAType (Type of Moving Average for Fast-D). Sum(vars Data, int TimePeriod): var Sum of all Data elements in the time period. T3(vars Data, int TimePeriod, var VFactor): var An extremely smoothed Moving Average by Tim Tillson. Uses a weighted sum of multiple EMAs. Parameters: VFactor (Volume Factor, normally 0.7). TEMA(vars Data, int TimePeriod): var Triple Exponential Moving Average by Patrick Mulloy, calculated from (3xEMA)-(3xEMA of EMA)(EMA of EMA of EMA) . Trima(vars Data, int TimePeriod): var Triangular Moving Average (also known under the name TMA ) a form of Weighted Moving Average where the weights are assigned in a triangular pattern. F. i. the weights for a 7 period Triangular Moving Average would be 1, 2, 3, 4, 3, 2, 1. This gives more weight to the middle of the time series. It causes better smoothing, but greater lag. Trix(vars Data, int TimePeriod): var 1-day Rate-Of-Change (see ROC ) of a Triple EMA (see TEMA ). TrueRange(): var True Range (TR) max(High0,Close1)-min(Low0,Close1) of the current asset price series. See also ATR . ATR S. TSF(vars Data, int TimePeriod): var Time Series Forecast. Returns b m(TimePeriod) . i. e. the Linear Regression forecast for the next bar. TSI(vars Data, int TimePeriod): var Trend Strength Index, an indicator by Frank Hassler who believed that it identifies trend strength. A high TSI value (above 1.65 ) indicates that short-term trend continuation is more likely than short-term trend reversal. The function internally creates series and thus must be called in a fixed order in the script. TypPrice(): var Typical Price. Simply (High Low Close)3 . Uses the current asset price series. UltOsc(int TimePeriod1, int TimePeriod2, int TimePeriod3): var Ultimate Oscillator. Parameters: TimePeriod1 (Number of bars for 1st period.), TimePeriod2 (Number of bars for 2nd period), TimePeriod3 (Number of bars for 3rd period). Uses the current asset price series. Does not support TimeFrame . UO(vars Data, int CutOff): var Universal oscillator by John Ehlers, from SampC Magazine 12018. Removes white noise from the data, smoothes it and runs it through the AGC filter. Detects trend reversals very early. Output in the -1..1 range. Source code in indicators. c . The function internally creates series and thus must be called in a fixed order in the script. Variance(vars Data, int TimePeriod): var Variance of the Data series in the time period, from the ta-lib . Use Moment when high accuracy or long time periods are required. Volatility(vars Data, int TimePeriod): var Annualized volatility of the Data series standard deviation of the log returns, multiplied with the square root of time frames in a year. This is the standard measure of volatility used for financial models, such as the Black-Scholes model. The function internally creates series and thus must be called in a fixed order in the script. Source code in indicators. c . VolatilityC(int TimePeriod, int EMAPeriod): var Chaikin Volatility indicator by Marc Chaikin measures volatility in percent as momentum of the smoothed difference between High and Low. An increase in the Chaikin Volatility indicates that a bottom is approaching, a decrease indicates that a top is approaching. TimePeriod is the period of the momentum (normally 10), EMAPeriod determines the smoothing (also, normally 10). Uses the current asset price series. The function internally creates series and thus must be called in a fixed order in the script. Source code in indicators. c . VolatilityMM(vars Data, int TimePeriod, int EMAPeriod): var MinMax volatility of the Data series the difference of MaxVal and MinVal in the time period, smoothed by an EMA (set EMAPeriod 0 for not smoothing). The function internally creates a series when EMAPeriod gt 0 . and then must be called in a fixed order in the script. Source available in indicators. c . For the volatility of price candles, use ATR or ATRS. VolatilityOV(int Days): var Annualized volatility of the current asset, calculated over the given number of Days (usually 20). Empirical formula used by some options software packages (OptionsVue 8482) for estimating the values of options, alternatively to Volatility() . Source code in options. c . which must be included for using this indicator. WCLPrice(): var Weighted Close Price. Uses the current asset price series. WillR(int TimePeriod): var Williams Percent Range. Formula: -100 (HH-Close)(HH-LL) . Uses the current asset price series. Does not support TimeFrame . WMA(vars Data, int TimePeriod): var Linear Weighted Moving Average the weight of every bar decreases linearly with its age. ZigZag(vars Data, var Depth, int Length, int Color): var ZigZag indicator converts the Data series into alternating straight trend lines with at least the given Depth and Length . Non-predictive can only identify trends in hindsight. Returned: rSlope (the slope of the last identified trend line upwards trends have a positive slope, downwards trends a negative slope) rPeak (the bar offset of the last identified peak) rSign ( 1 if the last peak was a top, -1 if the last peak was a bottom) rLength (the number of bars of the last trend line ending with rPeak ). If a nonzero Color is given, the trend lines are plotted in the chart. Source code in indicators. c . example in Indicatortest. c . The function internally creates series and thus must be called in a fixed order in the script. ZMA(vars Data, int TimePeriod): var Zero-lag Moving Average by John Ehlers smoothes the Data series with an Exponential Moving Average (EMA ) and applies an error correction term for compensating the lag. The function internally creates a series and thus must be called in a fixed order in the script. Source in indicators. c . Standard parameters: The number of bars for the time period of the function, if any or 0 for using a default period. A data series. often directly derived from the price functions price(), priceClose() etc. Alternatively a user created series or any other double float array with the given minimum length can be used. If not mentioned otherwise, the minimum length of the Data series is TimePeriod . Some functions require a second data array Data2 . Price data series can be explicitly given for some indicators, for using price series generated from a different asset or with a different TimeFrame. Otherwise the prices of the current asset with a time frame equivalent to the bar period are used. Price variation or percentage, dependent on the function, for the current bar. Usage example: MACD(Price,12,26,9) calculates the standard MACD for the given Price series. The results are stored in the global variables rMACD . rMACDSignal . and rMACDHistory . The TA-Lib function prototypes are defined in includeta. h . Information about the usage and the indicator algorithms can be found online at tadoc. org. The C source code of all included TA-Lib indicators is contained in Sourcetalib. zip and can be studied for examining the algorithms. Some TA-Lib indicators that originally didnt work properly - such as Correlation or SAR - have been replaced by working versions. The lite-C source code of most additional indicators that are not part the the TA-Lib is contained in includeindicators. c . All TA functions are applied on series and do normally not accept other data arrays. In the INITRUN. all TA functions return 0 . and LookBack is automatically increased to the largest required lookback time by a TA function. Recursive TA functions - f. i. EMA or ATR - need a higher lookback period than their TimePeriod parameter (see UnstablePeriod ). LookBack can be exceeded when TA functions are later called with a series offset or a different TimePeriod this will generate an Error 046 message. Make sure that LookBack is always higher than the maximum TimePeriod plus the UnstablePeriod plus the highest possible offset of all used series. Some functions return more than one value, f. i. MACD . The returned results are stored in global variables beginning with quot r quot they can be accessed after the function is called. Some functions only require a single Data value. Rather than creating a Data series of length 1 . simply a pointer to the Data value can be used. Example: var Raw MyIndicator() var Transformed AGC(ampRaw,0) . TimeFrame affects subsequent data series and thus also affects all indicators that use the data series as input. The TimePeriod is then not in Bar units, but in time frame units. TimeFrame has no effect on indicators that do not use data series. Indicators that rely on the standard deviation (f. i. Bollinger Bands) become inaccurate when the standard deviation is below 0.0001, as it is then assumed to be zero by the TA-Lib. This can happen on very short bar periods when the price does (almost) not move. For writing your own indicators, have a look at the examples inside indicators. c . But please do not modify indicators. c - write the indicators in your own script, or in a dedicated script that you can then include in your strategies. If you need a complex indicator that you can not be easily add, please ask for it on the Zorro user forum.

Comments