TTS system V 4 AFL Provide More Information
Amibroker AFL
11,415 views
TTS SYSTEM V 4 FOR AMIBROKER AFL
TTS system V 4 Amibroker AFL is for advance professional users. This AFL is coded by different formulas. That’s mean this AFL is a combined Amibroker AFL. AFL Formula use many terms and condition. By using this afl you can understand the maker movement.
TTS system is well known in Technical Analysis world. It is popular for many information provide at a time in real market. That’s mean you get more information in one page at a time. This AFL Formula refers information like trend line, support & resistance line as well as calculate major point of a pair.
You may follow the Image that gives you more information about this.
Image of AFL [amibroker formula language].
HERE IS AMIBROKER AFL CODE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 | //------------------------------------------------------------------------------ // Formula Name : TTS SYSTEM V 4 FOR AMIBROKER AFL by pipschart // Author : KrT group // Uploader : www.pipschart.com // E-mail : info@pipschart.com // Amibroker Blog : www.pipschart.com/amibroker // Origin : Modified & Collected from different sources. //------------------------------------------------------------------------------ _SECTION_BEGIN("KrT group"); GfxSetBkMode(1); X=750; Y=1; Font=10; GfxSelectFont("Impact",Font*2.2, 550);GfxSetTextColor(colorRed);GfxTextOut("KrT group",x,y); GfxSelectFont("Impact",Font*2.2, 550);GfxSetTextColor(colorGreen);GfxTextOut("RESEARCH",x+120,Y); _SECTION_END(); //------------------------------------------------------------------------------ messageboard = ParamToggle("Message Board","Show|Hide",0); messageboardj= ParamToggle("messageboardj","Show|Hide",1); pdsdaily=ParamToggle("pdshd","daily|hourly",1); Pdss = Param("daily", 36, 2, 300, 1, 21 ); Pdsa = Param("hourly", 16, 2, 300, 1, 6 ); bslable= ParamToggle("bslable","Show|Hide",1); text = ParamToggle("Plot Text","Off|On",1); fibs = ParamToggle("Plot Fibs","Off|On",0); Show_color = ParamToggle("Display CandleColor", "No|Yes", 1); ParmClouda = ParamToggle("Clouda", "No|Yes", 1); prexplore= ParamToggle("perce/buysell","pers|buysell",1); LinearRegression = ParamToggle("regline","Show|Hide",1); trendlines = ParamToggle("trendline","Show|Hide",1); pivot = ParamToggle("pivot","Show|Hide",1); Buyselllable = ParamToggle("Buysell-lable","Show|Hide",0); NormalCandle=ParamToggle("Plot Normal Candle", "No,Yes", 0 ); font = ParamToggle("font","Show|Hide",1); GraphXSpace = Param( "GraphXSpace", 8, 2, 200, 1 ); _SECTION_END(); Avga = Param("Pdsl", 5, 2, 300, 1, 7 ); //a=WMA( P, Periods ); //b=DEMA( P, Periods ); if(pdsdaily==0) { Sell=Cross( WMA((H+L)/2,pdsa),Avg); Buy=Cross( Avg, WMA((H+L)/2,pdsa)); } else { Sell=Cross( WMA((H+L)/2,pdss),Avg); Buy=Cross( Avg, WMA((H+L)/2,pdss)); } Cover=Buy; Short=Sell; _SECTION_END(); if(font==0) { _SECTION_BEGIN("Name"); GfxSetOverlayMode(0); GfxSelectFont("Tahoma", Status("pxheight")/8 ); GfxSetTextAlign( 6 );// center alignment GfxSetTextColor( ColorHSB( 42, 42, 42 ) ); GfxSetBkMode(0); // transparent GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/12 ); GfxSelectFont("Tahoma", Status("pxheight")/18 ); GfxTextOut("" , Status("pxwidth")/2, Status("pxheight")/4 ); GfxSelectFont("Tahoma", Status("pxheight")/18 ); GfxSelectFont("Tahoma", Status("pxheight")/36 ); GfxTextOut( "", Status("pxwidth")/2, Status("pxheight")/3 ); _SECTION_END(); //Magfied Market Price FS=Param("Font Size",72,11,100,1); GfxSelectFont("Times New Roman", FS, 700, True ); GfxSetBkMode(0); // transparent GfxSetTextColor( ColorHSB( 42, 42, 42 ) ); Hor=Param("Horizonta Position",615,1,1200,1); Ver=Param("Vertica Position",152,1,830,1); GfxTextOut(""+C, Hor , Ver ); YC=TimeFrameGetPrice("C",inDaily,-1); DD=Prec(C-YC,2); xx=Prec((DD/YC)*100,2); FS2=Param("Font Size2",35,11,100,1); GfxSelectFont("Times New Roman", FS2,11, 700, True ); GfxSetBkMode( colorBlack ); Hor1=Param("Horizontal Position",615,1,1200,1); Ver1=Param("Vertical Position",188,1,830,1); GfxSetTextColor( ColorHSB( 42, 42, 42 ) ); GfxTextOut(""+DD+" ("+xx+"%)", Hor1 , Ver1+45 ); } else {{ //Magfied Market Price fse=Param("Font Sizee",35,11,100,1); GfxSelectFont("Times New Roman", fse, 700, True ); GfxSetBkMode( colorGold ); GfxSetTextColor( ParamColor("Color",colorGold) ); Hora=Param("Horizontal Positiona",525,1,1200,1); Vera=Param("Vertical Positiona",17,1,830,1); GfxTextOut(""+C, Hora , Vera ); YCa=TimeFrameGetPrice("C",inDaily,-1); DDa=Prec(C-YCa,2); xxa=Prec((DDa/YCa)*100,2); FSb=Param("Font Sizeb",16,11,100,1); GfxSelectFont("Times New Roman",fsb, 700, True ); GfxSetBkMode( colorBlack ); GfxSetTextColor(ParamColor("Color",colorYellow) ); GfxTextOut(""+DDa+" ("+xxa+"%)", Hora , Vera+45 ); _SECTION_END(); }} _SECTION_BEGIN("MAMA"); SetBarsRequired( 10000, 10000 ); SetChartOptions(0,chartShowArrows|chartShowDates); prc = ( High + Low ) / 2; fastlimit = 0.5; slowlimit = 0.05; pi=4*atan(1); RTD=180/pi; DTR=pi/180; Cyclepart=Param("Alpha",0.2,0.1,1,0.1); Smooth[0] = Period = Detrender[0] = I1[0] = Q1[0] = 0; phase[0]=deltaphase[0]=MAMA[0]=FAMA[0]=0; for ( i = 6; i < BarCount; i++ ) { Smooth[i] = ( 4 * prc[i] + 3 * prc[i-1] + 2 * prc[i-2] + prc[i-3] ) / 10; AmpCorr[i] = 0.075 * Period[i-1] + 0.54; Detrender[i] = ( 0.0962 * Smooth[i] + 0.5769 * Smooth[i-2] - 0.5769 * Smooth[i-4] - 0.0962 * Smooth[i-6] ) * AmpCorr[i]; Q1[i] = ( 0.0962 * Detrender[i] + 0.5769 * Detrender[i-2] - 0.5769 * Detrender[i-4] - 0.0962 * Detrender[i-6] ) * AmpCorr[i]; I1[i] = Detrender[i-3]; if (I1[i] != 0) phase[i] = DTR*360/atan(q1[i]/I1[i]); deltaphase[i]=phase[i-1]-phase[i]; if (deltaphase[i] <1) deltaphase[i]=1; alpha[i]=fastlimit[i]/deltaphase[i]; if (alpha[i] < slowlimit[i]) alpha[i]=slowlimit[i]; MAMA[i]=alpha[i] * prc [i] +(1-alpha[i])*MAMA[i-1]; FAMA[i]=Cyclepart*alpha[i] * prc [i] +(1-Cyclepart*alpha[i])*FAMA[i-1]; } per= Param("per",10,1,50,1,0) ; //Plot(MAMA,"Trendm",colorGreen); //Plot(FAMA,"Downma",colorYellow); //Plot(MA(FAMA,per),"Downm",colorRed); FAMAe=MA(FAMA,per); _SECTION_END(); _SECTION_BEGIN("Rays1"); p = Param("p",5,2,100,1); Om=DEMA(O,p); hm=DEMA(H,p); lm=DEMA(L,p); Cm=DEMA(C,p); HAC=(Om+Hm+Lm+Cm)/4; //HaC =(O+H+L+C)/4; HaO = AMA( Ref( HaC, -1 ), 0.5 ); HaH = Max( H, Max( HaC, HaO) ); HaL = Min( L, Min( HaC, HaO) ); HAClose=(Om+Hm+Lm+Cm)/4; //HaC =(O+H+L+C)/4; HaOpen = AMA( Ref( HaC, -1 ), 0.5 ); HaHigh = Max( H, Max( HaC, HaO) ); HaLow = Min( L, Min( HaC, HaO) ); BG3=HHV(LLV(HaL,4)+ATR(4),8); BR3=LLV(HHV(HaH ,4)-ATR(4),8); //Plot(BG3,"Close", colorTeal, styleLine); //Plot(BR3,"Close", colorBlue, styleLine); line=ParamToggle("Line","No|Yes",1); if(line) { Pp1=Param("Ray_Period1",3,1,20,1); Pp2=Param("ATR_Period1",4,1,20,1); Cal=HHV(LLV(HaHigh,Pp1)-ATR(Pp2),5); //Plot(Cal,"",Linecolor ,ParamStyle("styleLine 1",styleLine|styleThick,maskAll)); positive= Cross(HaClose,Cal); negative=Cross(Cal,HaClose); PlotShapes( IIf( positive, shapeHollowSmallCircle, shapeNone ), colorBrightGreen, layer = 0, yposition = HaLow, offset = -4); PlotShapes( IIf( negative, shapeHollowSmallCircle, shapeNone ), colorRed, layer = 0, yposition = HaHigh, offset = 4); } //Sell=Cross(Cal,HaClose); //Buy= Cross(HaClose,Cal); _SECTION_END(); //Buy=Cross(MAMA,FAMAe); //Sell=Cross(FAMAe,MAMA); PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0); PlotShapes(IIf(Buy,shapeHollowUpArrow,shapeNone),colorWhite,0); PlotShapes(IIf(Buy,shapeHollowSmallCircle,shapeNone),colorWhite,0); PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0); PlotShapes(IIf(Sell,shapeHollowDownArrow,shapeNone),colorWhite,0); PlotShapes(IIf(Sell,shapeHollowSmallCircle,shapeNone),colorWhite,0); PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,L,-15); PlotShapes(IIf(Buy,shapeHollowUpArrow,shapeNone),colorWhite,0,L,-15); PlotShapes(IIf(Buy,shapeHollowSmallCircle,shapeNone),colorWhite,0,BuyPrice,0); PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,H,-15); PlotShapes(IIf(Sell,shapeHollowDownArrow,shapeNone),colorWhite,0,H,-15); PlotShapes(IIf(Sell,shapeHollowSmallCircle,shapeNone),colorWhite,0,SellPrice,0); PlotShapes(IIf(Short,shapeDownTriangle,shapeNone),colorYellow,0,H,IIf(Short AND Sell,-30,-15)); PlotShapes(IIf(Short,shapeHollowDownTriangle,shapeNone),colorWhite,0,H,IIf(Short AND Sell,-30,-15)); PlotShapes(IIf(Short,shapeHollowCircle,shapeNone),colorWhite,0,ShortPrice,0); PlotShapes(IIf(Cover,shapeUpTriangle,shapeNone),colorLightBlue,0,L,IIf(Cover AND Buy,-30,-15)); PlotShapes(IIf(Cover,shapeHollowUpTriangle,shapeNone),colorWhite,0,L,IIf(Cover AND Buy,-30,-15)); PlotShapes(IIf(Cover,shapeHollowCircle,shapeNone),colorWhite,0,CoverPrice,0); //Plot(Close, "Close", colorTeal, styleBar); _SECTION_BEGIN("MAMA"); SetBarsRequired( 10000, 10000 ); SetChartOptions(0,chartShowArrows|chartShowDates); prc = ( High + Low ) / 2; fastlimit = 0.5; slowlimit = 0.05; pi=4*atan(1); RTD=180/pi; DTR=pi/180; Cyclepart=Param("Alpha",0.5,0.1,1,0.1); Smooth[0] = Period = Detrender[0] = I1[0] = Q1[0] = 0; phase[0]=deltaphase[0]=MAMA[0]=FAMA[0]=0; for ( i = 6; i < BarCount; i++ ) { Smooth[i] = ( 4 * prc[i] + 3 * prc[i-1] + 2 * prc[i-2] + prc[i-3] ) / 10; AmpCorr[i] = 0.075 * Period[i-1] + 0.54; Detrender[i] = ( 0.0962 * Smooth[i] + 0.5769 * Smooth[i-2] - 0.5769 * Smooth[i-4] - 0.0962 * Smooth[i-6] ) * AmpCorr[i]; Q1[i] = ( 0.0962 * Detrender[i] + 0.5769 * Detrender[i-2] - 0.5769 * Detrender[i-4] - 0.0962 * Detrender[i-6] ) * AmpCorr[i]; I1[i] = Detrender[i-3]; if (I1[i] != 0) phase[i] = DTR*360/atan(q1[i]/I1[i]); deltaphase[i]=phase[i-1]-phase[i]; if (deltaphase[i] <1) deltaphase[i]=1; alpha[i]=fastlimit[i]/deltaphase[i]; if (alpha[i] < slowlimit[i]) alpha[i]=slowlimit[i]; MAMA[i]=alpha[i] * prc [i] +(1-alpha[i])*MAMA[i-1]; FAMA[i]=Cyclepart*alpha[i] * prc [i] +(1-Cyclepart*alpha[i])*FAMA[i-1]; } //Plot(MAMA,"Trendm",colorGreen); //Plot(FAMA,"Downm",colorRed); _SECTION_END(); SetChartOptions(0, chartShowDates); //MYcolor = IIf( uptrend, colorBrightGreen, IIf(downtrend , colorRed, colorBlue)); _SECTION_END(); _SECTION_BEGIN("Beta Adjusted Trailing Stops-P.Kaufman& Bullkowski "); dif=Ref(High,0)-Ref(Low,0); dif1=Ref(High,-1)-Ref(Low,-1); dif2=Ref(High,-2)-Ref(Low,-2); dif3=Ref(High,-3)-Ref(Low,-3); dif4=Ref(High,-4)-Ref(Low,-4); dif5=Ref(High,-5)-Ref(Low,-5); dif6=Ref(High,-6)-Ref(Low,-6); dif7=Ref(High,-7)-Ref(Low,-7); dif8=Ref(High,-8)-Ref(Low,-8); dif9=Ref(High,-9)-Ref(Low,-9); dif10=Ref(High,-10)-Ref(Low,-10); dif11=Ref(High,-11)-Ref(Low,-11); dif12=Ref(High,-12)-Ref(Low,-12); dif13=Ref(High,-13)-Ref(Low,-13); dif14=Ref(High,-14)-Ref(Low,-14); dif15=Ref(High,-15)-Ref(Low,-15); dif16=Ref(High,-16)-Ref(Low,-16); dif17=Ref(High,-17)-Ref(Low,-17); dif18=Ref(High,-18)-Ref(Low,-18); dif19=Ref(High,-19)-Ref(Low,-19); dif20=Ref(High,-20)-Ref(Low,-20); dif21=Ref(High,-21)-Ref(Low,-21); Sumdif=(dif+dif1+dif2+dif3+dif4+dif5+dif6+dif7+dif8+dif9+dif10+dif11+dif12+dif13+dif14+dif15+dif16+dif17+dif18+dif19+dif20+dif21)/22; mp = Param("Multiplier",2,0.25,5,0.25); Sumdifml=(Sumdif*1); Sumdifml2=(Sumdif*1.5); Sumdifml3=(Sumdif*mp); Betastops=HHV(C,22) - Sumdifml; Betastops2=HHV(C,22) - Sumdifml2; Betastops3=HHV(C,22) - Sumdifml3; //Plot(Betastops3, "BATS", ParamColor( "Color2", colorGold ),ParamStyle("Style2",styleThick,maskAll)); //Pivot Cal Pp = ((High +Low + Close) / 3); R1 = (Pp * 2) - Low; R2 = (Pp + High) - Low; R3 = R1 +(High-Low); S1 = (Pp * 2) - High; S2 = (Pp - High) + Low; S3 = S1 - (High-Low); //5 Year New High-New Low pdyear = Param("6-Month Back",1300,65,2600,65); pdyear1=pdyear/260; HI3 = High > Ref(HHV(High,pdyear),-1); LI3 = Low < Ref(LLV(Low,pdyear),-1); HIV3= Ref(HHV(High,pdyear),-1); LIV3=Ref(LLV(Low,pdyear),-1); //HI=H>HIV1; //LI=L<LIV1; //Long-term Price Trend(LTPT) rc= C > EMA (C,50) AND C < EMA(C,200) AND EMA(C,50) < EMA(C,200); ac= C > EMA (C,50) AND C > EMA(C,200) AND EMA(C,50) < EMA(C,200); bl= C > EMA (C,50) AND C > EMA(C,200) AND EMA(C,50) > EMA(C,200); wr= C < EMA (C,50) AND C > EMA(C,200) AND EMA(C,50) > EMA(C,200); ds= C < EMA (C,50) AND C < EMA(C,200) AND EMA(C,50) > EMA(C,200); br= C < EMA (C,50) AND C < EMA(C,200) AND EMA(C,50) < EMA(C,200); //---------------------------------------------------------------------------------------- // Find Short Term Reversals - Closing Price, Hook, Island, Key, Open-Close // and Pivot Point Reversals using automatic analysis //------------------------ //Wad: Larry Williams Acc/Distribution Status TRH = IIf(Ref(C, -1) > H, Ref(C, -1), H); TRL = IIf(Ref(C, -1) < L, Ref(C, -1), L); ad = IIf(C > Ref(C, -1), C - TRL, IIf(C < Ref(C, -1), C - TRH, 0)); WAD = Cum(ad); wu = wad > Ref(wad,-1); wd = wad < Ref(wad,-1); //wad_status= WriteIf(wu, "Rising", WriteIf(wd, "Falling", "Neutral")); //30 Week New High-New Low HI2 = High > Ref(HHV(High,130),-1); LI2 = Low < Ref(LLV(Low,130),-1); HIV2=Ref(HHV(High,130),-1); LIV2=Ref(LLV(Low,130),-1); //52 Week New High-New Low HI = High > Ref(HHV(High,260),-1); LI = Low < Ref(LLV(Low,260),-1); HIV1= Ref(HHV(High,260),-1); LIV1=Ref(LLV(Low,260),-1); //HI=H>HIV1; //LI=L<LIV1; ///////////////// _SECTION_BEGIN("Line"); a = Param("Average Pds", 5, 1, 10, 1 ); n = Param("Short Pds", 8, 5, 21, 1 ); m = Param("Long Pds", 60, 0, 90, 1 ); Var4 =(Low+High+2*Close)/4; OP = EMA(Var4,a); res1 = HHV(OP,n); res2 =HHV(OP,m); sup2 =LLV(OP,m); sup1 =LLV(OP,n); Linecolor = IIf(Op==sup1,colorCustom12,IIf(Op==res1,10,7)); /*Closing Price Reversals Automatic Analysis by Larry Lovrencic*/ CPRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L<Ref(L,-1) AND C>Ref(C,-1); CPRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H>Ref(H,-1) AND L>Ref(L,-1) AND C<Ref(C,-1); /*Hook Reversals Automatic Analysis by Larry Lovrencic*/ HRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L>Ref(L,-1); HRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H<Ref(H,-1) AND L>Ref(L,-1); /*Island Reversals Automatic Analysis by Larry Lovrencic*/ IRbuy=Ref(L,-2)>Ref(H,-1) AND L>Ref(H,-1); IRsell=Ref(H,-2)<Ref(L,-1) AND H<Ref(L,-1); /*Key Reversals Automatic Analysis by Larry Lovrencic*/ KRbuy=O<Ref(C,-1) AND L<Ref(L,-1) AND C>Ref(H,-1); KRsell=O>Ref(C,-1) AND H>Ref(H,-1) AND C<Ref(L,-1); /*Open/Close Reversals Automatic Analysis by Larry Lovrencic*/ OCRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L<Ref(L,-1) AND C<Ref(C,-1); OCRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H>Ref(H,-1) AND L>Ref(L,-1) AND C>Ref(C,-1); /*Pivot Point Reversals Automatic Analysis by Larry Lovrencic*/ PPRbuy=Ref(L,-1)<Ref(L,-2) AND Ref(L,-1)<L AND C>Ref(H,-1); PPRsell=Ref(H,-1)>Ref(H,-2) AND Ref(H,-1)>H AND C<Ref(L,-1); Buyr=Cover=CPRbuy OR HRbuy OR IRbuy OR KRbuy OR OCRbuy OR PPRbuy; Sellr=Short=CPRsell OR HRsell OR IRsell OR KRsell OR OCRsell OR PPRsell; Buyr=ExRem(Buyr,Sellr); Sellr=ExRem(Sellr,Buyr); Short=ExRem(Short,Cover); Cover=ExRem(Cover,Short); Filter= CPRbuy OR CPRsell OR HRbuy OR HRsell OR IRbuy OR IRsell OR KRbuy OR KRsell OR OCRbuy OR OCRsell OR PPRbuy OR PPRsell; //Filter=Buyr OR Sellr OR Short OR Cover; //----------------------------------------------------------------------------- _SECTION_BEGIN("VSA by Mr.Karthik"); Pp1=Param("NumberOfDays",30,1,200,1); Pp2=Param("VolOfDays",15,1,200,1); numDays = Pp1; dwWideSpread = 1.8; dwNarrowSpread = 0.8; dwSpreadMiddle = 0.5; dwHighClose = 0.7; dwLowClose = 0.3; volNumDays = Pp2; dwUltraHighVol = 2; dwVeryHighVol = 1.75; // was 1.8 dwHighVol = 1.75; // was 1.8 dwmoderateVol = 1.10; // was 1.8 dwLowVol = 0.75; // was 0.8 //////////////////////////////////////////////////////////////////////////////////// // // Classify each bar... // //////////////////////////////////////////////////////////////////////////////////// upBar = C > Ref(C,-1); downBar = C < Ref(C,-1); spread = H-L; avgRange = Sum(spread, numDays) / numDays; wideRange = spread >= (dwWideSpread * avgRange); narrowRange = spread <= (dwNarrowSpread * avgRange); testHighClose = L + (spread * dwHighClose); testLowClose = L + (spread * dwLowClose); testCloseMiddle = L + (spread * dwSpreadMiddle); upClose = C > testHighClose; downClose = C < testLowClose; middleClose = C >= testLowClose AND C <= testHighClose; avgVolume = EMA(V, volNumDays); highVolume = V > (avgVolume * dwHighVol); moderateVol= V > (avgVolume * dwmoderateVol); veryHighVolume = V > (avgVolume * dwVeryHighVol); ultraHighVolume = V > (avgVolume * dwUltraHighVol); LowVolume = V < (avgVolume * dwLowVol); //////////////////////////////////////////////////////////////////////////////////// // // direction and title // //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// // // Basic patterns... // //////////////////////////////////////////////////////////////////////////////////// upThrustBar = downClose AND H > Ref(H,-1) AND (C == L) AND downClose AND (NOT narrowRange); noDemandBar = narrowRange AND LowVolume AND upBar AND (NOT upClose); //noDemandBar = narrowRange AND LowVolume AND upBar AND (V < Ref(V,-1)) AND (V < Ref(V,-2)); noSupplyBar = narrowRange AND LowVolume AND downBar AND (V < Ref(V,-1)) AND (V < Ref(V,-2)); absorption = Ref(downbar, -1) AND Ref(highVolume, -1) AND upBar; support = Ref(downBar,-1) AND (NOT Ref(downClose,-1)) AND Ref(highVolume,-1) AND upBar; stoppingVolume = Ref(downBar,-1) AND Ref(highVolume,-1) AND C > testCloseMiddle AND (NOT downBar); bullishsign=moderateVol+UpThrustBar;//OR moderateVol+upBar; //rallyEnd = (Ref(highVolume,-1) AND Ref(upBar,-1) AND wideRange AND downBar) OR // (narrowRange AND highVolume AND H > Ref(HHV(H, 250), -1)); //////////////////////////////////////////////////////////////////////////////////// // // Strength and Weakness // //////////////////////////////////////////////////////////////////////////////////// weakness = upThrustBar OR noDemandBar OR (narrowRange AND (H > Ref(H,-1)) AND highVolume) OR (Ref(highVolume,-1) AND Ref(upBar,-1) AND downBar AND (H < Ref(H,-1))); _SECTION_END(); //ROC(V,1); //IIf(ROC(V,1) > 0, colorGreen, colorRed); Vol=(ROC(V,1)); CP=(ROC(C,1)); _SECTION_BEGIN("Bull vs Bear Volume"); C1 = Ref(C, -1); uc = C > C1; dc = C <= C1; ud = C > O; dd = C <= O; green = 1; blue = 2; yellow = 3; red = 4; white = 5; VType = IIf(ud, IIf(uc, green, yellow), IIf(dd, IIf(dc, red, blue), white)); /* green volume: up-day and up-close*/ gv = IIf(VType == green, V, 0); /* yellow volume: up-day but down-close */ yv = IIf(VType == yellow, V, 0); /* red volume: down-day and down-close */ rv = IIf(VType == red, V, 0); /* blue volume: down-day but up-close */ bv = IIf(VType == blue, V, 0); uv = gv + bv; uv1 = Ref(uv, -1); /* up volume */ dv = rv + yv; dv1 = Ref(dv, -1); /* down volume */ /* create moving average period parameters */ VolPer = Param("Adjust Vol. MA per.", 34, 1, 255, 1); ConvPer = Param("Adjust Conv. MA per.", 9, 1, 255, 1); /* create triple exponential moving avearges of separate up and down volume moving averages */ MAuv = TEMA(uv, VolPer ); mauv1 = Ref(mauv, -1); MAdv = TEMA(dv, VolPer ); madv1 = Ref(madv, -1); MAtv = TEMA(V, VolPer );//total volume /* Rise/Fall Convergence variables: */ Converge = (TEMA(MAuv - MAdv, ConvPer)); Converge1 = Ref(Converge, -1); ConvergeUp = Converge > Converge1; ConvergeOver = Converge > 0; rising = ConvergeUp AND ConvergeOver; falling = !ConvergeUp AND ConvergeOver; _SECTION_BEGIN("Resistance"); HaClose =EMA((O+H+L+C)/4,3); // Woodie HaOpen = AMA( Ref( HaClose, -1 ), 0.5 ); HaHigh = Max( H, Max( HaClose, HaOpen ) ); HaLow = Min( L, Min( HaClose, HaOpen ) ); //LISTING 1 function ZeroLagTEMA( array, period ) { TMA1 = TEMA( array, period ); TMA2 = TEMA( TMA1, period ); Diff = TMA1 - TMA2; return TMA1 + Diff ; } haClose = ( haClose + haOpen + haHigh + haLow )/4; period = Param("Avg. TEMA period", 55, 1, 100 ); ZLHa = ZeroLagTEMA( haClose, period ); ZLTyp = ZeroLagTEMA( Avg, period ); Plot( ZLHa, "ZLTema(Ha,"+period+")", colorRed ); Plot( ZLTyp, "ZLTema(Typ,"+period+")", colorGreen ); TMBuy = Cross( ZLTyp, ZLHa ); TMSell = Cross( ZLHa, ZLTyp ); TMBuy1= ZLTyp> ZLHa ; TMSell1=ZLHa> ZLTyp ; _SECTION_END(); DTL=Param("Linear regression period",60,10,100,10); wbf=Param("WRB factor",1.5,1.3,2.5,.1); nbf=Param("NRB factor",0.7,0.3,0.9,0.1); TL=LinRegSlope(MA(C, DTL),2); Vlp=Param("Volume lookback period",30,20,300,10); Vrg=MA(V,Vlp); St = StDev(Vrg,Vlp); Vp3 = Vrg + 3*st; Vp2 = Vrg + 2*st;; Vp1 = Vrg + 1*st;; Vn1 = Vrg -1*st; Vn2 = Vrg -2*st; rg=(H-L); arg=Wilders(rg,30); wrb=rg>(wbf*arg); nrb=rg<(nbf*arg); Vl=V<Ref(V,-1) AND V<Ref(V,-2); upbar=C>Ref(C,-1); dnbar=C<Ref(C,-1); Vh=V>Ref(V,-1) AND Ref(V,-1)>Ref(V,-2); Cloc=C-L; x=rg/Cloc; x1=IIf(Cloc==0,arg,x); Vb=V>Vrg OR V>Ref(V,-1); ucls=x1<2; dcls=x1>2; mcls=x1<2.2 AND x1>1.8 ; Vlcls=x1>4; Vhcls=x1<1.35; j=MA(C,5); TLL=LinRegSlope(j,40) ; Tlm=LinRegSlope(j,15) ; tls=LinRegSlope(j,5); mp=(H+L)/2; // Trend Detection function Rise( Pd, perd, Pl, perl ) { MAD = DEMA(Pd,perd); MAL = LinearReg(Pl,perl); CondR = ROC(MAD,1)>0 AND ROC(MAL,1)>0; CondF = ROC(MAD,1)<0 AND ROC(MAL,1)<0; R[0] = C[0]>(H[0]+L[0])/2; for(i=1;i<BarCount;i++) { if( CondR[i] ) { R[i] = 1; } else { if( CondF[i] ) { R[i] = 0; } else { R[i] = R[i-1]; } } } return R; } PrD = C; PrL = H/2+L/2; PrdD = PrdL = PrdM = Param("Prd",12,2,40,1); permax = Max(prdd,prdl); Rs = IIf( BarIndex()<permax, 0, Rise(PrD, PrdD, PrL, PrdL) ); Fs = IIf( BarIndex()<permax, 0, 1-Rs ); Confirm = MA(C,prdm); function DirBar( dr, df ) { B[0] = 0; for(i=1;i<BarCount;i++) { if( dr[i-1] && df[i] ) { B[i] = 1; } else { if( df[i-1] && dr[i] ) { B[i] = 1; } else { B[i] = B[i-1] + 1; } } } return B; } Bs = DirBar( Rs, Fs ); Direction = ROC(Confirm,1) > 0 AND ROC(Confirm,5) > 0; Downward = ROC(Confirm,1) < 0 AND ROC(Confirm,5) < 0; Select = Rs AND Ref(Fs,-1); Caution = Fs AND Ref(Rs,-1); _SECTION_END(); function T3(price,periods) { s = 0.84; e1=EMA(price,periods); e2=EMA(e1,Periods); e3=EMA(e2,Periods); e4=EMA(e3,Periods); e5=EMA(e4,Periods); e6=EMA(e5,Periods); c1=-s*s*s; c2=3*s*s+3*s*s*s; c3=-6*s*s-3*s-3*s*s*s; c4=1+3*s+s*s*s+3*s*s; Ti3=c1*e6+c2*e5+c3*e4+c4*e3; return ti3; } Chg=Ref(C,-1); Cg = Foreign("00DSEGEN", "C"); Cgo= Ref(Cg,-1); //Longterm Bullish or Bearish Bullg = Cg > WMA(Cg,200); Bearg= Cg <WMA(Cg,200); //Midterm Bullish or Bearish mBullg = Cg >WMA(Cg,50); mBearg= Cg <WMA(Cg,50); //Shortterm Bullish or Bearish sBullg = Cg >WMA(Cg,15); sBearg= Cg <WMA(Cg,15); //////////////////////////////// //Price Volume Breakout: close greater than last close and volume at least twice as much 50-day MA HIV = C > Ref (C,-1) AND V > (MA(V,15)*2); LIV = C < Ref (C,-1) AND V < (MA(V,15)*2); //------------------------------------------------------------ //Initial Buy Signal Ibuy = Cross(RSI(14), EMA(RSI(14),9)); Isell = Cross(EMA(RSI(14),9), RSI(14)); Ibuy = ExRem(Ibuy, ISell); Isell = ExRem(ISell, Ibuy); BlRSI = RSI(14) > EMA(RSI(14),9); BrRSI = RSI(14) < EMA(RSI(14),9); //Price Smoothing -T3 TBuy = Cross (T3(C,3), T3(C,5)); TSell = Cross (T3(C,5), T3(C,3)); TBuy = ExRem(TBuy, TSell); TSell = ExRem(TSell, TBuy); T33 = T3(C,3) > T3(C,5); T333 = T3(C,3) < T3(C,5); //Tillson's Part (RSI Smoothing) TillsonBuy = Cross (t3(RSI(9),3), t3(RSI(9),5)); TillsonSell = Cross (t3(RSI(9),5), t3(RSI(9),3)); TB = t3(RSI(9),3)> t3(RSI(9),5); TS = t3(RSI(9),3)< t3(RSI(9),5); //ZerolagEMA & T-3 Crosses P = ParamField("Price field",-1); Periods = Param("Periods", 4, 2, 200, 1, 10 ); EMA1=EMA(P,Periods); EMA2=EMA(EMA1,Periods); Difference=EMA1-EMA2; ZerolagEMA=EMA1+Difference; ebuy = Cross(ZerolagEma, t3(ZerolagEma,3)); esell = Cross(t3(ZerolagEma,3), ZerolagEma); ebuy1 = ZerolagEma > t3(ZerolagEma,3); esell1= t3(ZerolagEma,3)>ZerolagEma; //Stochastics Part //StochBuy = Cross(StochK(9,3), StochD(9,3,3)); //StochSell = Cross (StochD(9,3,3), StochK(9,3)); //StBuy=StochK(9,3)>StochD(9,3,3); //StSell=StochK(9,3)<StochD(9,3,3); //Stochastics Part StochKval = StochK(10,5); StochDval = StochD(10,5,5); StochBuy = Cross(StochK(10,5), StochD(10,5,5)); StochSell = Cross (StochD(10,5,5), StochK(10,5)); StBuy=StochK(10,5)>StochD(10,5,5); StSell=StochK(10,5)<StochD(10,5,5); //Filter = Buy OR Sell; //Stochbuy_status= WriteIf(StochBuy, "Buy", WriteIf(StochSell, "Sell", "No Signal")); //Stoch_Col=IIf(StochBuy, colorGreen, IIf(StochSell, colorRed, colorLightGrey)); //PlotShapes( IIf( StochBuy, shapeSmallCircle, shapeNone ), 7, layer = 0, yposition = 0, offset = 0); //PlotShapes(IIf(StochBuy AND StochKval<26,35,shapeNone),colorBrightGreen,layer = 0, yposition = 0, offset = -30); //PlotShapes(IIf(StochBuy AND StochKval > 26,33,shapeNone),colorPaleBlue,layer = 0, yposition = 0, offset = -30); //PlotShapes(IIf(StochSell AND StochKval>67,37,shapeNone),colorRed,layer = 0, yposition = 0, offset = 0); //_SECTION_BEGIN("ZL W%R"); R = ((HHV(H,14) - C) /(HHV (H,14) -LLV (L,14))) *-100; MaxGraph=10; Period= 10; EMA1= EMA(R,Period); EMA2= EMA(EMA1,5); Difference= EMA1 - EMA2; ZeroLagEMA= EMA1 + Difference; PR=100-abs(ZeroLagEMA); MoveAvg=MA(PR,5); ZBuy = Cross(PR,moveAvg) AND PR<30; ZSell = Cross(moveAvg,PR) AND PR>70; ZBuy1= PR>= MoveAvg AND PR>= Ref(PR,-1) ; ZSell1=(PR < MoveAvg) OR PR>= MoveAvg AND PR< Ref(PR,-1) ; _SECTION_END(); _SECTION_BEGIN("Mabiuts-Mr.Karthik"); mabBuy=EMA(C,13)>EMA(EMA(C,13),9) AND Cross (C,Peak(C,5,1)); mabSell=Cross (EMA(EMA(C,13),9),EMA(C,13)); mabBuy1= EMA(C,13)>EMA(EMA(C,13),9) AND C>Peak(C,2,1); mabSell1 =EMA(C,13)>EMA(EMA(C,13),9) AND C<Peak(C,2,1); _SECTION_END(); _SECTION_BEGIN("JSB_Pic_DMX_3"); SetBarsRequired(100000, 100000); range=Param( "Length ", 9, 0, 500); aup = MA(C,range) > 0; adown = MA(C,range) < 0; achoppy = MA(C,range) < DEMA(C,range) AND MA(C,range) < DEMA(C,range); adxBuy = Cross(DEMA(C,range), MA(C,range)); adxSell = Cross(MA(C,range), DEMA(C,range)); adxBuy = ExRem(adxBuy, adxSell); adxSell = ExRem(adxSell, adxBuy); adxbuy1 = DEMA(C,range) > MA(C,range); adxsell1 = MA(C,range)> DEMA(C,range); //Plot( JSB_JDMXplus( Close, Length), "JDMXplus", colorGreen, styleLine); //Plot( JSB_JDMXminus( Close, Length), "JDMXminus", colorRed, styleLine); //Plot( JSB_JDMX( Close, Length), "JDMX", colorBlue, styleLine | styleOwnScale); _SECTION_END(); //MACD Signal Crosses MB= Cross (MACD(), Signal()); MS = Cross( Signal(), MACD()); MB = ExRem(MB, MS); MS = ExRem(MS, MB); MB1= MACD() > Signal(); MS1= MACD() < Signal(); //_SECTION_BEGIN("MA-T3 Setting"); // Probable MA-T3 Cross-Oracle p=Param("Cross Period 1",4,1,20,1); //4 MAp=T3(C,p); k=Param("Cross Period 2",5,1,20,1);//6 MAk=T3(C,k); y=p*T3(C,p)-(p-1)*Ref(T3(C,p-1),-1); tClose=(p*(k-1)*T3(C,k-1)-k*(p-1)*T3(C,p-1))/(k-p); DescCrossPrediction=Cross(tClose,C); AscCrossPrediction=Cross(C,tClose); ExpectMAcross=DescCrossPrediction OR AscCrossPrediction; Confirmed=Cross(MAk,MAp) OR Cross(MAp,MAk); UR=2*Highest(ROC(C,1));LR=2*Lowest(ROC(C,1)); Ucoeff=1+UR/100;Lcoeff=1+LR/100; Filter=tClose<Lcoeff*C OR tClose>Ucoeff*C; //AddColumn(MAp,"MAp"); //AddColumn(MAk,"MAk"); //Plot(C,"",7*Filter+1,64); //No. '64' designates price chart as candle //Plot(MAp,"",7,1); //Red Line - The No. '4' designates the red color & No. '1' //Plot(MAk,"",2,1); //Green Line - - The No. '4' designates the red color & No. '1' bars=BarsSince(Cross(MAp,MAk) OR Cross(MAk,MAp)); expect=NOT(Filter); orBuy=AscCrossPrediction; orSell=DescCrossPrediction; orBuy1=(C>tClose); orSell1=(tClose>C); _SECTION_END(); _SECTION_BEGIN("Breakout Setting"); Buyperiods=Param("Breakout periods",5,1,100,1,1); BuyBreakout= C>Ref(HHV(H,Buyperiods),-1); Buyperiods2=Param("2 Breakout periods",17,1,100,1,1); BuyBreakout2= Cross( C, Ref( HHV(H,Buyperiods2), -1 ) ); _SECTION_END(); _SECTION_BEGIN("Pivot Box"); Hi=Param("High_Period",7,1,50,1); Lo=Param("Low_Period",7,1,50,1); A1=ExRemSpan(Ref(High,-2)==HHV(High,Hi),3); A2=ExRemSpan(Ref(Low,-2)==LLV(Low,Lo),3); A3=Cross(A1,0.9); A4=Cross(A2,0.9); TOP=Ref(haHigh,-BarsSince(A3)); YY1=TOP; bot=Ref(haLow,-BarsSince(A4)); XX1=bot; ///////////////// _SECTION_BEGIN("Haiken"); //Show_color = ParamToggle("Display CandleColor", "No|Yes", 1); r1 = Param( "ColorFast avg", 5, 2, 200, 1 ); r2 = Param( "ColorSlow avg", 10, 2, 200, 1 ); r3 = Param( "ColorSignal avg", 5, 2, 200, 1 ); Prd1=Param("ATR Period",4,1,20,1); Prd2=Param("Look Back",7,1,20,1); green = HHV(LLV(L,Prd1)+ATR(Prd1),Prd2); red = LLV(HHV(H,Prd1)-ATR(Prd1),Prd2); m1=MACD(r1,r2); s1=Signal(r1,r2,r3); mycolor=IIf(m1<0 AND m1>s1, ColorRGB(230,230,0),IIf(m1>0 AND m1>s1,ColorRGB(0,0,100),IIf(m1>0 AND m1<s1,colorOrange,colorDarkRed))); if(Show_color) { ColorHighliter = myColor; SetBarFillColor( ColorHighliter ); } xChange1=Cg - Ref(Cg,-1); Change1 = StrFormat("%1.2f% ",xChange1); barche1= xChange1>=0; Comche1= xChange1<0; xperchange1 = xChange1/100; perchange1 = StrFormat("%1.2f% ",xperchange1); positivechange1 = xperchange1>0; negativechange1 = xperchange1<0; Prd1=Param("Weekly_Period1",3,1,200,1); Prd2=Param("Weekly_Period2",5,1,200,1); TM = T3 ( Close , Prd1 ) ; TM2 = T3 ( Close , Prd2 ) ; UTM = IIf(Close>TM AND Close<TM2,8, IIf(Close>TM AND Close>TM2,5, IIf(Close<TM AND Close>TM2,13, IIf(Close<TM AND Close<TM2,4,2)))); //up=Close>TM AND Close<TM2; wup=Close>TM AND Close>TM2; wflat=Close<TM AND Close>TM2; wdown=Close<TM AND Close<TM2; TimeFrameRestore(); //Longterm Bullish or Bearish //Bull = C > T3(C,233); //Bear= C < T3(C,233); Bull = C > WMA(C,200); Bear= C <WMA(C,200); //Midterm Bullish or Bearish //mBull = C > T3(C,55); //mBear= C < T3(C,55); mBull = C >WMA(C,50); mBear= C <WMA(C,50); //Shortterm Bullish or Bearish //sBull = C > T3(C,15); //sBear= C < T3(C,15); sBull = C >WMA(C,15); sBear= C <WMA(C,15); _SECTION_END(); _SECTION_BEGIN("Pivot"); nBars = Param("Number of bars", 12, 3, 40); LP=Param("LookBack Period",150,1,500,1); bShowTCZ = Param("Show TCZ", 0, 0, 1); nExploreBarIdx = 0; nExploreDate = 0; nCurDateNum = 0; DN = DateNum(); DT = DateTime(); bTCZLong = False; bTCZShort = False; nAnchorPivIdx = 0; ADX8 = ADX(8); if(Status("action")==1) { bDraw = True; bUseLastVis = 1; } else { bDraw = False; bUseLastVis = False; bTrace = 1; nExploreDate = Status("rangetodate"); for (i=LastValue(BarIndex());i>=0;i--) { nCurDateNum = DN[i]; if (nCurDateNum == nExploreDate) { nExploreBarIdx = i; } } } if (bDraw==0) { } aHPivs = HaHigh - HaHigh; aLPivs = HaLow - HaLow; aHPivHighs = HaHigh - HaHigh; aLPivLows = HaLow - HaLow; aHPivIdxs = HaHigh - HaHigh; aLPivIdxs = HaLow - HaLow; aAddedHPivs = HaHigh - HaHigh; aAddedLPivs = HaLow - HaLow; aLegVol = HaHigh - HaHigh; aRetrcVol = HaHigh - HaHigh; nHPivs = 0; nLPivs = 0; lastHPIdx = 0; lastLPIdx = 0; lastHPH = 0; lastLPL = 0; curPivBarIdx = 0; aHHVBars = HHVBars(HaHigh, nBars); aLLVBars = LLVBars(HaLow, nBars); aHHV = HHV(HaHigh, nBars); aLLV = LLV(HaLow, nBars); nLastVisBar = LastValue( Highest(IIf(Status("barvisible"), BarIndex(), 0))); curBar = IIf(nlastVisBar > 0 AND bUseLastVis, nlastVisBar, IIf(Status("action")==4 AND nExploreBarIdx > 0, nExploreBarIdx, LastValue(BarIndex()))); curTrend = ""; if (aLLVBars[curBar] < aHHVBars[curBar]) curTrend = "D"; else curTrend = "U"; if (curBar >= LP) { for (i=0; i<LP; i++) { curBar = IIf(nlastVisBar > 0 AND bUseLastVis, nlastVisBar-i, IIf(Status("action")==4 AND nExploreBarIdx > 0, nExploreBarIdx-i, LastValue(BarIndex())-i)); if (aLLVBars[curBar] < aHHVBars[curBar]) { if (curTrend == "U") { curTrend = "D"; curPivBarIdx = curBar - aLLVBars[curBar]; aLPivs[curPivBarIdx] = 1; aLPivLows[nLPivs] = HaLow[curPivBarIdx]; aLPivIdxs[nLPivs] = curPivBarIdx; nLPivs++; } } else { if (curTrend == "D") { curTrend = "U"; curPivBarIdx = curBar - aHHVBars[curBar]; aHPivs[curPivBarIdx] = 1; aHPivHighs[nHPivs] = HaHigh[curPivBarIdx]; aHPivIdxs[nHPivs] = curPivBarIdx; nHPivs++; } } } } curBar = IIf(nlastVisBar > 0 AND bUseLastVis, nlastVisBar, IIf(Status("action")==4 AND nExploreBarIdx > 0, nExploreBarIdx, LastValue(BarIndex())) ); if (nHPivs >= 2 AND nLPivs >= 2) { lastLPIdx = aLPivIdxs[0]; lastLPL = aLPivLows[0]; lastHPIdx = aHPivIdxs[0]; lastHPH = aHPivHighs[0]; nLastHOrLPivIdx = Max(lastLPIdx, lastHPIdx); nAddPivsRng = curBar - nLastHOrLPivIdx; aLLVAfterLastPiv = LLV(HaLow, nAddPivsRng); nLLVAfterLastPiv = aLLVAfterLastPiv[curBar]; aLLVIdxAfterLastPiv = LLVBars(HaLow, nAddPivsRng); nLLVIdxAfterLastPiv = curBar - aLLVIdxAfterLastPiv[curBar]; aHHVAfterLastPiv = HHV(HaHigh, nAddPivsRng); nHHVAfterLastPiv = aHHVAfterLastPiv[curBar]; aHHVIdxAfterLastPiv = HHVBars(HaHigh, nAddPivsRng); nHHVIdxAfterLastPiv = curBar - aHHVIdxAfterLastPiv[curBar]; if (lastHPIdx > lastLPIdx) { if (aHPivHighs[0] < aHPivHighs[1]) { if (nLLVAfterLastPiv < aLPivLows[0] AND (nLLVIdxAfterLastPiv - lastHPIdx - 1) >= 1 AND nLLVIdxAfterLastPiv != curBar ) { // -- OK, we'll add this as a pivot. // Mark it for plotting... aLPivs[nLLVIdxAfterLastPiv] = 1; aAddedLPivs[nLLVIdxAfterLastPiv] = 1; // ...and then rearrange elements in the // pivot information arrays for (j=0; j<nLPivs; j++) { aLPivLows[nLPivs-j] = aLPivLows[nLPivs-(j+1)]; aLPivIdxs[nLPivs-j] = aLPivIdxs[nLPivs-(j+1)]; } aLPivLows[0] = nLLVAfterLastPiv; aLPivIdxs[0] = nLLVIdxAfterLastPiv; nLPivs++; // -- Test whether to add piv given last piv is high // AND we have lower highs } // -- Here, the last piv is a high piv, and we have // higher-highs. The most likely addition is a // Low piv that is a retracement. } else { if (nLLVAfterLastPiv > aLPivLows[0] AND (nLLVIdxAfterLastPiv - lastHPIdx - 1) >= 1 AND nLLVIdxAfterLastPiv != curBar ) { // -- OK, we'll add this as a pivot. // Mark it for plotting... aLPivs[nLLVIdxAfterLastPiv] = 1; aAddedLPivs[nLLVIdxAfterLastPiv] = 1; // ...and then rearrange elements in the // pivot information arrays for (j=0; j<nLPivs; j++) { aLPivLows[nLPivs-j] = aLPivLows[nLPivs-(j+1)]; aLPivIdxs[nLPivs-j] = aLPivIdxs[nLPivs-(j+1)]; } aLPivLows[0] = nLLVAfterLastPiv; aLPivIdxs[0] = nLLVIdxAfterLastPiv; nLPivs++; // -- Test whether to add piv given last piv is high // AND we have lower highs } // -- The last piv is a high and we have higher highs // OR lower highs } /* **************************************************************** Still finding missed pivot(s). Here, the last piv is a low piv. **************************************************************** */ } else { // -- First case, lower highs if (aHPivHighs[0] < aHPivHighs[1]) { if (nHHVAfterLastPiv < aHPivHighs[0] AND (nHHVIdxAfterLastPiv - lastLPIdx - 1) >= 1 AND nHHVIdxAfterLastPiv != curBar ) { // -- OK, we'll add this as a pivot. // Mark that for plotting aHPivs[nHHVIdxAfterLastPiv] = 1; aAddedHPivs[nHHVIdxAfterLastPiv] = 1; // ...and then rearrange elements in the // pivot information arrays for (j=0; j<nHPivs; j++) { aHPivHighs[nHPivs-j] = aHPivHighs[nHPivs-(j+1)]; aHPivIdxs[nHPivs-j] = aHPivIdxs[nhPivs-(j+1)]; } aHPivHighs[0] = nHHVAfterLastPiv; aHPivIdxs[0] = nHHVIdxAfterLastPiv; nHPivs++; // -- Test whether to add piv given last piv is high // AND we have lower highs } // -- Second case when last piv is a low piv, higher highs // Most likely addition is high piv that is a retracement. // Considering adding a high piv as long as it is higher } else { // -- Where I have higher highs, if (nHHVAfterLastPiv > aHPivHighs[0] AND (nHHVIdxAfterLastPiv - lastLPIdx - 1) >= 1 AND nHHVIdxAfterLastPiv != curBar ) { // -- OK, we'll add this as a pivot. // Mark it for plotting... aHPivs[nHHVIdxAfterLastPiv] = 1; aAddedHPivs[nHHVIdxAfterLastPiv] = 1; // ...and then rearrange elements in the // pivot information arrays for (j=0; j<nHPivs; j++) { aHPivHighs[nHPivs-j] = aHPivHighs[nHPivs-(j+1)]; aHPivIdxs[nHPivs-j] = aHPivIdxs[nhPivs-(j+1)]; } aHPivHighs[0] = nHHVAfterLastPiv; aHPivIdxs[0] = nHHVIdxAfterLastPiv; nHPivs++; // -- Test whether to add piv given last piv is high // AND we have lower highs } } } // -- If there are at least two of each } /* **************************************** // -- Done with finding pivots ***************************************** */ if (bDraw) { // -- OK, let's plot the pivots using arrows PlotShapes( IIf(aAddedHPivs==1, shapeHollowSmallSquare|shapeStar, shapeNone), colorCustom12,layer = 0, yposition = HaHigh, offset = 13); PlotShapes( IIf(aAddedLPivs==1, shapeHollowSmallSquare|shapeStar, shapeNone), colorYellow, layer = 0, yposition = HaLow, offset = -13); } /* **************************************** // -- Done with discovering and plotting pivots ***************************************** */ // -- I'm going to want to look for possible retracement risk = 0; profInc = 0; nLeg0Pts = 0; nLeg0Bars = 0; nLeg0Vol = 0; nLeg1Pts = 0; nLeg1Bars = 0; nLeg1Vol = 0; nLegBarsDiff = 0; nRtrc0Pts = 0; nRtrc0Bars = 0; nRtrc0Vol = 0; nRtrc1Pts = 0; nRtrc1Bars = 0; nRtrc1Vol = 0; minRtrc = 0; maxRtrc = 0; minLine = 0; maxLine = 0; triggerLine = 0; firstProfitLine = 0; triggerInc = 0; triggerPrc = 0; firstProfitPrc = 0; retrcPrc = 0; retrcBar = 0; retrcBarIdx = 0; retrcRng = 0; aRetrcPrc = HaHigh-HaHigh; aRetrcPrcBars = HaHigh-HaHigh; aRetrcClose = HaClose; retrcClose = 0; // -- Do TCZ calcs. Arrangement of pivs very specific // for this setup. if (nHPivs >= 2 AND nLPivs >=2 AND aHPivHighs[0] > aHPivHighs[1] AND aLPivLows[0] > aLPivLows[1]) { tcz500 = (aHPivHighs[0] - (.5 * (aHPivHighs[0] - aLPivLows[1]))); tcz618 = (aHPivHighs[0] - (.618 * (aHPivHighs[0] - aLPivLows[1]))); tcz786 = (aHPivHighs[0] - (.786 * (aHPivHighs[0] - aLPivLows[0]))); retrcRng = curBar - aHPivIdxs[0]; aRetrcPrc = LLV(HaLow, retrcRng); aRetrcPrcBars = LLVBars(HaLow, retrcRng); retrcPrc = aRetrcPrc[curBar]; retrcBarIdx = curBar - aRetrcPrcBars[curBar]; retrcClose = aRetrcClose[retrcBarIdx]; // -- bTCZLong setup? bTCZLong = ( // -- Are retracement levels arranged in // tcz order? // .500 is above .786 for long setups tcz500 >= (tcz786 * (1 - .005)) AND // .681 is below .786 for long setups tcz618 <= (tcz786 * (1 + .005)) AND // -- Is the low in the tcz range // -- Is the close >= low of tcz range // and low <= high of tcz range retrcClose >= ((1 - .01) * tcz618) AND retrcPrc <= ((1 + .01) * tcz500) ); // -- risk would be high of signal bar minus low of zone //risk = 0; // -- lower highs and lower lows } else if (nHPivs >= 2 AND nLPivs >=2 AND aHPivHighs[0] < aHPivHighs[1] AND aLPivLows[0] < aLPivLows[1]) { tcz500 = (aHPivHighs[1] - (.5 * (aHPivHighs[1] - aLPivLows[0]))); tcz618 = (aHPivHighs[0] - (.618 * (aHPivHighs[1] - aLPivLows[0]))); tcz786 = (aHPivHighs[0] - (.786 * (aHPivHighs[0] - aLPivLows[0]))); retrcRng = curBar - aLPivIdxs[0]; aRetrcPrc = HHV(HaHigh, retrcRng); retrcPrc = aRetrcPrc[curBar]; aRetrcPrcBars = HHVBars(HaHigh, retrcRng); retrcBarIdx = curBar - aRetrcPrcBars[curBar]; retrcClose = aRetrcClose[retrcBarIdx]; bTCZShort = ( // -- Are retracement levels arranged in // tcz order? // .500 is below .786 for short setups tcz500 <= (tcz786 * (1 + .005)) AND // .681 is above .786 for short setups tcz618 >= (tcz786 * (1 - .005)) AND // -- Is the close <= high of tcz range // and high >= low of tcz range retrcClose <= ((1 + .01) * tcz618) AND retrcPrc >= ((1 - .01) * tcz500) ); // -- Risk would be top of zone - low of signal bar //risk = 0; } // -- Show zone if present if (bTCZShort OR bTCZLong) { // -- Be prepared to see symmetry if (bTCZShort) { if (aLPivIdxs[0] > aHPivIdxs[0]) { // -- Valuable, useful symmetry information nRtrc0Pts = aHPivHighs[0] - aLPivLows[1]; nRtrc0Bars = aHPivIdxs[0] - aLPivIdxs[1] + 1; nRtrc1Pts = retrcPrc - aLPivLows[0]; nRtrc1Bars = retrcBarIdx - aLPivIdxs[0] + 1; } else { nRtrc0Pts = aHPivHighs[1] - aLPivLows[1]; nRtrc0Bars = aHPivIdxs[1] - aLPivIdxs[1] + 1; nRtrc1Pts = aHPivHighs[0] - aLPivLows[0]; nRtrc1Bars = aHPivIdxs[0] - aLPivIdxs[0] + 1; } } else { // bLongSetup if (aLPivIdxs[0] > aHPivIdxs[0]) { nRtrc0Pts = aHPivHighs[0] - aLPivLows[1]; nRtrc0Bars = aHPivIdxs[0] - aLPivIdxs[1] + 1; nRtrc1Pts = retrcPrc - aLPivLows[0]; nRtrc1Bars = retrcBarIdx - aLPivIdxs[0] + 1; } else { nRtrc0Pts = aHPivHighs[1] - aLPivLows[0]; nRtrc0Bars = aLPivIdxs[0] - aHPivIdxs[1] + 1; nRtrc1Pts = aHPivHighs[0] - aLPivLows[0]; nRtrc1Bars = aLPivIdxs[0] - aHPivIdxs[0] + 1; } } if (bShowTCZ) { Plot( LineArray( IIf(bTCZLong, aHPivIdxs[0], aLPivIdxs[0]), tcz500, curBar, tcz500 , 0), "tcz500", colorPaleBlue, styleLine); Plot( LineArray( IIf(bTCZLong, aHPivIdxs[0], aLPivIdxs[0]), tcz618, curBar, tcz618, 0), "tcz618", colorPaleBlue, styleLine); Plot( LineArray( IIf(bTCZLong, aHPivIdxs[0], aLPivIdxs[0]), tcz786, curBar, tcz786, 0), "tcz786", colorTurquoise, styleLine); } // -- if (bShowTCZ) } _SECTION_END(); W52_High=WriteVal(HHV(H,260),1.2); W52_Low=WriteVal(LLV(L,260),1.2); _SECTION_BEGIN("Fundamental data"); declara=GetFnData("LastSplitDate" ); declara1=GetFnData("DividendPayDate" ); // yahoo.format //========================================================================================== utbar=wrb AND dcls AND tls>0 ; utcond1=Ref(utbar,-1) AND dnbar ; utcond2=Ref(utbar,-1) AND dnbar AND V>Ref(V,-1); utcond3=utbar AND V> 2*Vrg; trbar=Ref(V,-1)>Vrg AND Ref(upbar,-1) AND Ref(wrb,-1) AND dnbar AND dcls AND wrb AND tll>0 AND H==HHV(H,10); Hutbar=Ref(upbar,-1) AND Ref(V,-1)>1.5*Vrg AND dnbar AND dcls AND NOT wrb AND NOT utbar; Hutcond=Ref(Hutbar,-1) AND dnbar AND dcls AND NOT utbar; tcbar=Ref(upbar,-1) AND H==HHV(H,5)AND dnbar AND (dcls OR mcls) AND V>vrg AND NOT wrb AND NOT Hutbar ; Scond1=(utcond1 OR utcond2 OR utcond3) ; Scond2=Ref(scond1,-1)==0; scond=scond1 AND scond2; stdn0= tll<0 AND V>Ref(V,-1) AND Ref(dnbar,-1) AND upbar AND (ucls OR mcls) AND tls<0 AND tlm<0; stdn= V>Ref(V,-1) AND Ref(dnbar,-1) AND upbar AND (ucls OR mcls) AND tls<0 AND tlm<0; stdn1= tll<0 AND V>(vrg*1.5) AND Ref(dnbar,-1) AND upbar AND (ucls OR mcls)AND tls<0 AND tlm<0; stdn2=tls<0 AND Ref(V,-1)<Vrg AND upbar AND vhcls AND V>Vrg; bycond1= stdn OR stdn1; bycond= upbar AND Ref(bycond1,-1); stvol= L==LLV(L,5) AND (ucls OR mcls) AND V>1.5*Vrg AND tll<0; ndbar=upbar AND nrb AND Vl AND dcls ; nsbar=dnbar AND nrb AND Vl AND dcls ; nbbar= C>Ref(C,-1) AND Vl AND nrb AND x1<2; nbbar= IIf(C>Ref(C,-1) AND V<Ref(V,-1) AND V<Ref(V,-2) AND x1<1.1,1,0); lvtbar= vl AND L<Ref(L,-1) AND ucls; lvtbar1= V<Vrg AND L<Ref(L,-1) AND ucls AND tll>0 AND tlm>0 AND wrb; lvtbar2= Ref(Lvtbar,-1) AND upbar AND ucls; dbar= V>2*Vrg AND dcls AND upbar AND tls>0 AND tlm>0 AND NOT Scond1 AND NOT utbar; eftup=H>Ref(H,-1) AND L>Ref(L,-1) AND C>Ref(C,-1) AND C>=((H-L)*0.7+L) AND rg>arg AND V>Ref(V,-1); eftupfl=Ref(eftup,-1) AND (utbar OR utcond1 OR utcond2 OR utcond3); eftdn=H<Ref(H,-1) AND L<Ref(L,-1) AND C<Ref(C,-1) AND C<=((H-L)*0.25+L) AND rg>arg AND V>Ref(V,-1); _SECTION_END(); _SECTION_BEGIN("Commentary"); Vpc= utbar OR utcond1 OR utcond2 OR utcond3 OR stdn0 OR stdn1 OR stdn2 OR stdn OR lvtbar1 OR Lvtbar OR Lvtbar2 OR Hutbar OR Hutcond OR ndbar OR stvol OR tcbar; if( Status("action") == actionCommentary ) ( printf ( "=========================" +"\n")); printf ( "VOLUME PRICE ANALYSIS" +"\n"); //printf ( "www.vpanalysis.blogspot.com" +"\n"); printf ( "=========================" +"\n"); printf ( Name() + " - " +Interval(2) + " - " + Date() +" - " +"\n"+"High-"+H+"\n"+"Low-"+L+"\n"+"Open-"+O+"\n"+ "Close-"+C+"\n"+ "Volume= "+ WriteVal(V)+"\n"); WriteIf(Vpc,"=======================",""); WriteIf(Vpc,"VOLUME ANALYSIS COMMENTARY:\n",""); WriteIf(utbar , "Up-thrusts are designed to catch stops and to mislead as many traders as possible. They are normally seen after there has been weakness in the background. The market makers know that the market is weak, so the price is marked up to catch stops, encourage traders to go long in a weak market, AND panic traders that are already Short into covering their very good position.","")+ WriteIf(utcond3,"This upthrust bar is at high volume.This is a sure sign of weakness. One may even seriously consider ending the Longs AND be ready to reverse","")+WriteIf(utbar OR utcond3," Also note that A wide spread down-bar that appears immediately after any up-thrust, tends to confirm the weakness (the market makers are locking in traders into poor positions). With the appearance of an upthrust you should certainly be paying attention to your trade AND your stops. On many upthrusts you will find that the market will 'test' almost immediately.","")+WriteIf(utcond1 , "A wide spread down bar following a Upthrust Bar. This confirms weakness. The Smart Money is locking in Traders into poor positions",""); WriteIf(utcond2 , "Also here the volume is high( Above Average).This is a sure sign of weakness. The Smart Money is locking in Traders into poor positions","")+WriteIf(stdn, "Strength Bar. The stock has been in a down Trend. An upbar with higher Volume closing near the High is a sign of strength returning. The downtrend is likely to reverse soon. ","")+ WriteIf(stdn1,"Here the volume is very much above average. This makes this indication more stronger. ","")+ WriteIf(bycond,"The previous bar saw strength coming back. This upbar confirms strength. ","")+ WriteIf(Hutbar," A pseudo Upthrust. This normally appears after an Up Bar with above average volume. This looks like an upthrust bar closing down near the Low. But the Volume is normally Lower than average. this is a sign of weakness.If the Volume is High then weakness increases. Smart Money is trying to trap the retailers into bad position. ","")+ WriteIf(Hutcond, "A downbar after a pseudo Upthrust Confirms weakness. If the volume is above average the weakness is increased. ","")+ WriteIf(Lvtbar2,"The previous bar was a successful Test of supply. The current bar is a upbar with higher volume. This confirms strength","")+ WriteIf(dbar,"A wide range, high volume bar in a up trend closing down is an indication the Distribution is in progress. The smart money is Selling the stock to the late Comers rushing to Buy the stock NOT to be Left Out Of a Bullish move. ","")+ WriteIf(Lvtbar2,"The previous bar was a successful Test of supply. The current bar is a upbar with higher volume. This confirms strength","")+ WriteIf(tcbar,"The stock has been moving up on high volume. The current bar is a Downbar with high volume. Indicates weakness and probably end of the up move","")+ WriteIf(eftup,"Effort to Rise bar. This normally found in the beginning of a Markup Phase and is bullish sign.These may be found at the top of an Upmove as the Smart money makes a last effort to move the price to the maximum","")+ WriteIf(eftdn,"Effort to Fall bar. This normally found in the beginning of a Markdown phase.","")+ WriteIf(nsbar,"No Supply. A no supply bar indicates supply has been removed and the Smart money can markup the price. It is better to wait for confirmation","")+ WriteIf(stvol,"Stopping Volume. This will be an downbar during a bearish period closing towards the Top accompanied by High volume. A stopping Volume normally indicates that smart money is absorbing the supply which is a Indication that they are Bullishon the MArket. Hence we Can expect a reversal in the down trend. ","")+ WriteIf(ndbar, "No Demand Brief Description: Any up bar which closes in the middle OR Low, especially if the Volume has fallen off, is a potential sign of weakness. Things to Look Out for: if the market is still strong, you will normally see signs of strength in the next few bars, which will most probably show itself as a: * Down bar with a narrow spread, closing in the middle OR High. * Down bar on Low Volume.",""); _SECTION_END(); if(pivot==0) { Title = EncodeColor(colorYellow)+ Title = Name() + " " + EncodeColor(2) + Date() +EncodeColor(11)+ " " + EncodeColor(colorWhite) + "{{INTERVAL}} " + EncodeColor(55)+ " Open: "+ EncodeColor(colorWhite)+ WriteVal(O,format=1.2) + EncodeColor(55)+ " High: "+ EncodeColor(colorWhite) + WriteVal(H,format=1.2) + EncodeColor(55)+ " Low: "+ EncodeColor(colorWhite)+ WriteVal(L,format=1.2) + EncodeColor(55)+ " Close: "+ WriteIf(C> Chg,EncodeColor(colorBrightGreen),EncodeColor(colorRed))+ WriteVal(C,format=1.2)+ EncodeColor(55)+ " Change: "+ WriteIf(C> Chg,EncodeColor(colorBrightGreen),EncodeColor(colorRed))+ WriteVal(ROC(C,1),format=1.2)+ "%"+ EncodeColor(55)+ " Volume: "+ EncodeColor(colorWhite)+ WriteVal(V,1) +"\n"+EncodeColor(colorPink)+"-----------------------------------------" +"\n"+EncodeColor(colorOrange)+"TTS SYSTEM v3" +"\n"+EncodeColor(colorLightOrange)+"Amibroker comunity" +"\n"+EncodeColor(colorPink)+"-----------------------------------------" +"\n"+EncodeColor(colorWhite)+"G.Index: "+ WriteIf(Cg>Cgo,EncodeColor(08),EncodeColor(04))+WriteVal(Cg,format=1.2)+WriteIf(positivechange1, EncodeColor(colorBrightGreen),"")+WriteIf(negativechange1,EncodeColor(colorRed), "")+" ( "+WriteIf(barche1,"\\c08"+Change1,"")+WriteIf(barche1,"\\c08 ","")+WriteIf(Comche1,"\\c04"+Change1,"")+ WriteIf(Comche1,"\\c04 ","")+""+") " +"\n"+EncodeColor(colorWhite)+"Market Trend: "+ WriteIf(sBullg,EncodeColor(colorBrightGreen)+"UP",WriteIf(sBearg,EncodeColor(colorRed)+"Dwn",EncodeColor(colorYellow)+"Flat")) +EncodeColor(colorWhite) + " | " + WriteIf(mBullg,EncodeColor(colorBrightGreen)+"UP",WriteIf(mBearg,EncodeColor(colorRed)+"Dwn",EncodeColor(colorYellow)+"Flat")) +EncodeColor(colorWhite) + " | " + WriteIf(Bullg,EncodeColor(colorBrightGreen)+"UP",WriteIf(Bearg,EncodeColor(colorRed)+"Dwn",EncodeColor(colorYellow)+"Flat")) +"\n"+EncodeColor(colorPink)+"----------------------------------------- " +"\n"+EncodeColor(41)+"WeeklyTrend: " +WriteIf(wup,EncodeColor(colorBrightGreen)+"Up ", WriteIf(wdown,EncodeColor(colorRed)+"Down", WriteIf(wflat,EncodeColor(colorWhite)+"Flat ",""))) +EncodeColor(colorWhite) //+"\n"+EncodeColor(25)+"WeeklyTrend:" + WriteIf(up,EncodeColor(colorBrightGreen)+"UP",WriteIf(down,EncodeColor(colorRed)+"Down",WriteIf(flat,EncodeColor(colorYellow)+"Flat",""))) +"\n"+EncodeColor(26)+"S.TermTrend: " + WriteIf(sBull,EncodeColor(colorBrightGreen)+"UP",WriteIf(sBear,EncodeColor(colorRed)+"Down","Neutral")) +EncodeColor(colorWhite) + " | " //+WriteIf(tls>0,EncodeColor(colorLime)+"UP",EncodeColor(colorRed)+"Down") +WriteIf(Rs,EncodeColor(colorBrightGreen)+"UP",WriteIf(Fs,EncodeColor(colorRed)+"Down","Neutral")) +"\n"+EncodeColor(26)+"M.TermTrend: " + WriteIf(mBull,EncodeColor(colorBrightGreen)+"UP",WriteIf(mBear,EncodeColor(colorRed)+"Down","Neutral")) +EncodeColor(colorWhite) + " | " +WriteIf(tlm>0,EncodeColor(colorLime)+"UP",EncodeColor(colorRed)+"Down") +"\n"+EncodeColor(26)+"L.TermTrend: " + WriteIf(Bull,EncodeColor(colorBrightGreen)+"UP",WriteIf(Bear,EncodeColor(colorRed)+"Down","Neutral")) +EncodeColor(colorWhite) + " | " +WriteIf(tll>0,EncodeColor(colorLime)+"Up",EncodeColor(colorRed)+"Down") +"\n"+EncodeColor(colorPink)+"---------------------------------------- " +"\n"+EncodeColor(47)+"Signal(IBuy): " + WriteIf(Ibuy,EncodeColor(colorBrightGreen)+"BuyWarning",WriteIf(Isell,EncodeColor(colorRed)+"SellWarning",WriteIf(BlRSI,EncodeColor(colorBrightGreen)+"BullishZone",WriteIf(BrRSI,EncodeColor(colorRed)+"BearishZone","Neutral")))) +"\n"+EncodeColor(47)+"Signal(T3) : " + WriteIf(TBuy,EncodeColor(colorBrightGreen)+"Buy",WriteIf(TSell,EncodeColor(colorRed)+"Sell",WriteIf(T33,EncodeColor(colorBrightGreen)+"Bullish",WriteIf(T333,EncodeColor(colorRed)+"Bearish","Neutral")))) +"\n"+EncodeColor(47)+"Signal(ZLW) : " + WriteIf(ZBuy,EncodeColor(colorBrightGreen)+"Buy",WriteIf(ZSell,EncodeColor(colorRed)+"Sell",WriteIf(ZBuy1,EncodeColor(colorBrightGreen)+"Bullish",WriteIf(ZSell1,EncodeColor(colorRed)+"Bearish","Neutral")))) +"\n"+EncodeColor(47)+"Signal(Mab) : " + WriteIf(mabBuy,EncodeColor(colorBrightGreen)+"Buy",WriteIf(mabSell,EncodeColor(colorRed)+"Sell",WriteIf(mabBuy1,EncodeColor(colorBrightGreen)+"Bullish",WriteIf(mabSell1,EncodeColor(47)+"Neutral",EncodeColor(colorRed)+"Bearish")))) +"\n"+EncodeColor(47)+"Signal(TMA) : " + WriteIf(TMBuy,EncodeColor(colorBrightGreen)+"Buy",WriteIf(TMSell,EncodeColor(colorRed)+"Sell",WriteIf(TMBuy1,EncodeColor(colorBrightGreen)+"Bullish",WriteIf(TMSell1,EncodeColor(colorRed)+"Bearish","Neutral")))) +"\n"+EncodeColor(47)+"Signal(T3-RSI) : " + WriteIf(TillsonBuy,EncodeColor(colorBrightGreen)+"Buy",WriteIf(TillsonSell,EncodeColor(colorRed)+"Sell", WriteIf(TB,EncodeColor(colorBrightGreen)+"Bullish",WriteIf(TS,EncodeColor(colorRed)+"Bearish","Neutral")))) +"\n"+EncodeColor(47)+"Signal(ADX) : " + WriteIf(adxBuy,EncodeColor(colorBrightGreen)+"Buy",WriteIf(adxSell,EncodeColor(colorRed)+"Sell",WriteIf(adxBuy1,EncodeColor(colorBrightGreen)+"Bullish",WriteIf(adxSell1,EncodeColor(colorRed)+"Bearish","Neutral")))) +"\n"+EncodeColor(47)+"Signal(MACD) : " + WriteIf(MB,EncodeColor(colorBrightGreen)+"Buy",WriteIf(MS,EncodeColor(colorRed)+"Sell",WriteIf(MB1,EncodeColor(colorBrightGreen)+"Bullish",WriteIf(MS1,EncodeColor(colorRed)+"Bearish","Neutral")))) +"\n"+EncodeColor(47)+"Signal(Stoch) : " + WriteIf(StochBuy,EncodeColor(colorBrightGreen)+"Buy",WriteIf(StochSell,EncodeColor(colorRed)+"Sell",WriteIf(StBuy,EncodeColor(colorBrightGreen)+"Bullish",WriteIf(StSell,EncodeColor(colorRed)+"Bearish","Neutral")))) +"\n"+EncodeColor(47)+"Signal(TM) : "+ WriteIf(orBuy,EncodeColor(colorBrightGreen)+"Buy",WriteIf(orSell,EncodeColor(colorRed)+"Sell",WriteIf(orBuy1,EncodeColor(colorBrightGreen)+"Bullish",WriteIf(orSell1,EncodeColor(colorRed)+"Bearish","Neutral")))) //+"\n"+EncodeColor(47)+"Signal(Drava) : " + WriteIf(Buyrule,EncodeColor(colorBrightGreen)+"Buy",WriteIf(Sellrule,EncodeColor(colorRed)+"Sell",WriteIf(Buyrule1,EncodeColor(colorBrightGreen)+"Bullish",WriteIf(Sellrule1,EncodeColor(colorRed)+"Bearish","Neutral")))) +"\n"+EncodeColor(47)+"Signal(P5/15):" + WriteIf(Buybreakout,EncodeColor(colorBrightGreen)+"BreakOut1",WriteIf(Buybreakout2>Buybreakout,EncodeColor(colorBrightGreen)+"BreakOut2","Neutral")) +"\n"+EncodeColor(47)+"Signal(B):"+WriteIf(C>YY1,EncodeColor(colorBrightGreen)+"BreakOut",WriteIf(C<XX1,EncodeColor(colorRed)+"BreakDown","Neutral")) +"\n"+EncodeColor(colorPink)+"----------------------------------------" +"\n"+EncodeColor(07)+"Volume: "+WriteIf(V |