Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Isfandi Trading System II for Amibroker (AFL)
Formulation System: ADX candle, Sigma Band, Channel Trendline Breakout, Calculation Bar, Pivot Finder, MA Swing and many indicator recommendation.
Best Regards,
Isfandi
Screenshots
Similar Indicators / Formulas
Indicator / Formula
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 | _SECTION_BEGIN ( "ADX Candle stick " ); SetChartOptions (0, chartShowArrows | chartShowDates ); _N (Title = StrFormat ( "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}" , O , H , L , C , SelectedValue ( ROC ( C , 1 ) ) )); if ( SetBarFillColor ( IIf ( ( C < O ) AND ( C < Ref ( C , -1)), colorPlum , colorDarkGreen ) ) ); else ( SetBarFillColor ( IIf ( ( C > O ) AND ( C < Ref ( C , -1)), colorWhite , colorWhite ))); Plot ( C , "Close" , IIf ( Close < Ref ( Close , -1), colorRed , colorGreen ), styleCandle ); _SECTION_END (); _SECTION_BEGIN ( "Detecting double tops and bottoms" ); /* Detecting double tops and bottoms (for come into view, by Isfandi)*/ percdiff = 5; /* peak detection threshold */ fwdcheck = 5; /* forward validity check */ mindistance = 10; validdiff = percdiff/400; PK= Peak ( H , percdiff, 1 ) == High ; TR= Trough ( L , percdiff, 1 ) == Low ; x = Cum ( 1 ); XPK1 = ValueWhen ( PK, x, 1 ); XPK2 = ValueWhen ( PK, x, 2 ); xTR1 = ValueWhen ( Tr, x, 1 ); xTr2 = ValueWhen ( Tr, x, 2 ); peakdiff = ValueWhen ( PK, H , 1 )/ ValueWhen ( PK, H , 2 ); Troughdiff= ValueWhen ( tr, L , 1 )/ ValueWhen ( tr, L , 2 ); doubletop = PK AND abs ( peakdiff - 1 ) < validdiff AND (Xpk1 -Xpk2)>mindistance AND High > HHV ( Ref ( H , fwdcheck ), fwdcheck - 1 ); doubleBot=tr AND abs ( troughdiff - 1 ) < validdiff AND (Xtr1 -Xtr2)>mindistance AND Low < LLV ( Ref ( L , fwdcheck ), fwdcheck - 1 ); Buy = doublebot; Sell = doubletop; for ( i = 0; i < BarCount ; i++ ) { if ( Buy [i] ) PlotText ( "BOT " , i, L [ i ], colorYellow ); if ( Sell [i] ) PlotText ( "TOP" , i, H [ i ], colorWhite ); } WriteIf ( Highest ( doubletop ) == 1, "AmiBroker has detected some possible double top patterns for " + Name () + "\nLook for green arrows on the price chart." , "There are no double top patterns for " + Name () ); WriteIf ( Lowest ( doublebot)==1, "AmiBroker has detected some possible double bottom patterns for " + Name () + "\nLook for red arrows on the price chart." , "There are no double bottom patterns for " + Name () ); _SECTION_END (); _SECTION_BEGIN ( "My Name" ); GfxSetBkColor ( colorBlack ); GfxSetTextColor ( colorGrey40 ); GfxSelectFont ( "Impact" , 12, 500, True ); GfxTextOut ( "Isfandi Trading System II" , 10 , 848 ); _SECTION_END (); _SECTION_BEGIN ( "Wall Indicator System_Isfandi" ); //---- pivot points DayH = TimeFrameGetPrice ( "H" , inDaily , -1); // yesterdays high DayL = TimeFrameGetPrice ( "L" , inDaily , -1); //low DayC = TimeFrameGetPrice ( "C" , inDaily , -1); //close DayO = TimeFrameGetPrice ( "O" , inDaily ); // current day open HiDay = TimeFrameGetPrice ( "H" , inDaily ); LoDay = TimeFrameGetPrice ( "L" , inDaily ); PP = (DayH + DayL + DayO + DayO) / 4 ; R1 = (2 * PP) - DayL; S1 = (2 * PP) - DayH; R2 = PP + R1 - S1; S2 = PP + S1 - R1; R3 = R2 + (R1 - PP); S3 = S2 - (PP - S1); // OTHER INDICATOR MOMETUM = RSI (14); radius = 0.1 * Status ( "pxheight" ); // get pixel height of the chart and use 45% for pie chart radius textoffset = 0.1 * radius; GfxSelectFont ( "Arial" , 9, 500, True ); GfxSetTextColor ( colorGrey50 ); GfxTextOut ( "PIVOT POINT" , textoffset , 288 ); GfxSetTextColor ( colorGrey50 ); GfxTextOut ( "SIGNAL" , textoffset , 188 ); GfxSetTextColor ( colorGrey50 ); GfxTextOut ( "TREND" , textoffset ,386 ); GfxSelectFont ( "Arial" , 9 ); GfxSetTextColor ( colorGreen ); GfxTextOut ( "R1 =" + R1, textoffset + 1, 320 ); GfxSetTextColor ( colorLime ); GfxTextOut ( "R2 = " +R2, textoffset + 1, 305 ); GfxSetTextColor ( colorWhite ); GfxTextOut ( "PP = " +PP, textoffset + 1, 335 ); GfxSetTextColor ( colorOrange ); GfxTextOut ( "S1 = " +S1, textoffset + 1, 350 ); GfxSetTextColor ( colorRed ); GfxTextOut ( "S2 = " +S2, textoffset + 1, 365 ); GfxSelectFont ( "Arial" , 9 ); _SECTION_END (); ////////////////////////////////////////////////////////////////////// _SECTION_BEGIN ( "Elder Impulse" ); GfxSelectFont ( "Arial" , 8, 500, True ); /////////////////////////////////////////////////// SetChartOptions (0, chartShowArrows | chartShowDates ); EnableTextOutput ( False ); // User-defined parameter for EMA periods EMA_Type = Param ( "EMA-1, TEMA-2, JMA-3" , 2, 1, 3, 1); EMA_prds = Param ( "EMA_periods" , 7, 1, 30, 1); Std_MACD = Param ( "Standard MACD? No-0, Yes-1" , 1, 0, 1, 1); Plot_fashion = Param ( "Bar+Arrows-1, Impulse Bars-2" , 2, 1, 2, 1); // Allow user to define Weekly and Monthly Ribbon Location and Height WR_P1 = Param ( "Weekly Ribbon Location" , 5.2, -1000, 1000, 0.1); WR_P2 = Param ( "Weekly Ribbon Height" , 199, -0.001, 500, 0.1); //MR_P1 = Param("Monthly Ribbon Location", 5.2, -1000, 1000, 0.1); //MR_P2 = Param("Monthly Ribbon Height", 199, -0.001, 500, 0.1); // Compute EMA and MACD Histogram if (EMA_Type == 1) { DayEMA = EMA ( Close , EMA_prds); } if (EMA_Type == 2) { DayEMA = TEMA ( Close , EMA_prds); } Histogram = MACD () - Signal (); // Determine if we have an Impulse UP, DOWN or None Impulse_Up = DayEMA > Ref (DayEMA, -1) AND Histogram > Ref (Histogram, -1); Impulse_Down = DayEMA < Ref (DayEMA, -1) AND Histogram < Ref (Histogram, -1); Impulse_None = ( NOT Impulse_UP) AND ( NOT Impulse_Down); // Compute Weekly MACD and determine whether rising or falling TimeFrameSet ( inWeekly ); if (Std_MACD == 0) { MACD_val = MACD (5, Cool); Signal_val = Signal (5, 8, 5); } else { MACD_val = MACD (12, 26); Signal_val = Signal (12, 26, 9); } Hist_in_w = MACD_val - Signal_val; wh_rising = Hist_in_w > Ref (Hist_in_w, -1); wh_falling = Hist_in_w < Ref (Hist_in_w, -1); wh_none = ( NOT wh_rising) AND ( NOT wh_falling); TimeFrameRestore (); // Now get Monthly MACD Histogram.... TimeFrameSet ( inMonthly ); MACD_val = MACD (5, 8); Signal_val = Signal (5, 8, 5); Hist_in_m = MACD_val - Signal_val; mh_rising = Hist_in_m > Ref (Hist_in_m, -1); mh_falling = Hist_in_m < Ref (Hist_in_m, -1); TimeFrameRestore (); wh_rising = TimeFrameExpand ( wh_rising, inWeekly , expandLast ); wh_falling = TimeFrameExpand ( wh_falling, inWeekly , expandLast); wh_none = TimeFrameExpand ( wh_none, inWeekly , expandLast); mh_rising = TimeFrameExpand (mh_rising, inMonthly , expandLast); mh_falling = TimeFrameExpand (mh_falling, inMonthly , expandLast); kol = IIf ( wh_rising, colorBrightGreen , IIf (wh_falling, colorRed , IIf (wh_none, colorCustom11 , colorLightGrey ))); mkol = IIf ( mh_rising, colorBlue , IIf (mh_falling, colorYellow , colorLightGrey )); if (Plot_fashion == 1) { } else { bar_kol = IIf (impulse_UP, colorBrightGreen , IIf (impulse_Down, colorRed , colorCustom11 )); } Impulse_State = WriteIf (Impulse_Up, "Bulllish" , WriteIf (Impulse_Down, "Bearish" , "Neutral" )); GfxSetTextColor ( colorPink ); GfxTextOut ( "IMPULSE STATE = " +Impulse_State, textoffset + 1, 402 ); // Set the background color for Impulse Status Column Impulse_Col = IIf (Impulse_Up, colorGreen , IIf (Impulse_Down, colorRed , colorGrey40 )); // Determine Weekly Trend. Display as Text Column Weekly_Trend = WriteIf (wh_rising, "Rising" , WriteIf (wh_falling, "Falling" , "Flat!" )); Weekly_Col = IIf (wh_rising, colorGreen , IIf (wh_falling, colorRed , colorLightGrey )); GfxSetTextColor ( colorPink ); GfxTextOut ( "WEEKLT TREND = " +Weekly_Trend, textoffset + 1, 417 ); // Determine Monthly Trend. Display as Text Column Monthly_Trend = WriteIf (mh_rising, "Rising" , WriteIf (mh_falling, "Falling" , "Flat!" )); Monthly_Col = IIf (mh_rising, colorGreen , IIf (mh_falling, colorRed , colorLightGrey )); GfxSetTextColor ( colorPink ); GfxTextOut ( "MONTHLY TREND = " +Monthly_Trend, textoffset + 1, 432 ); // Determine how many bars has the current state existed bars_in_bull = Min ( BarsSince (impulse_none), BarsSince (impulse_down)); bars_in_bear = Min ( BarsSince (impulse_up), BarsSince (impulse_none)); bars_in_neut = Min ( BarsSince (impulse_down), BarsSince (impulse_up)); // Set a single variable to show number of bars in current state depending upon // actual Impulse Status - Bullish, Bearish or Neutral bars_in_state = IIf (Impulse_Up, bars_in_bull, IIf (Impulse_down, bars_in_bear, bars_in_neut)); //weekly pivot k1=-1; SetChartBkColor (16 ) ; k= IIf ( ParamList ( "select type" , "daily|next day" )== "daily" ,-1,0); k1=-1; TimeFrameSet ( inDaily ); day_h= LastValue ( Ref ( H ,K)); day_l= LastValue ( Ref ( L ,K)); day_c= LastValue ( Ref ( C ,K)); TimeFrameRestore (); // day DH=Day_h; DL=Day_L; DC=Day_C; // DAY PIVOT Calculation pd = ( DH+ DL + DC )/3; sd1 = (2*pd)-DH; sd2 = pd -(DH - DL); sd3 = Sd1 - (DH-DL); rd1 = (2*pd)-DL; rd2 = pd +(DH -DL); rd3 = rd1 +(DH-DL); WriteVal ( StochK (39) - StochK (12) ); GfxSelectFont ( "Arial" , 8 ); _SECTION_END (); _SECTION_BEGIN ( "STOCHASTIC" ); periods = Param ( "Periods" , 15, 1, 200, 1 ); Ksmooth = Param ( "%K avg" , 3, 1, 200, 1 ); a = StochK ( periods , Ksmooth); Dsmooth = Param ( "%D avg" , 3, 1, 200, 1 ); b = StochD ( periods , Ksmooth, DSmooth ); Buy = Cross ( a, b ); Sell = Cross ( b, a ); STOCH = WriteIf (a>b , "BUY" , "SELL" ); GfxSetTextColor ( colorYellow ); GfxTextOut ( "STOCH = " +STOCH, textoffset + 1, 229 ); GfxSelectFont ( "Arial" , 8 ); _SECTION_BEGIN ( "Van K Tharp Efficient Stocks" ); // Mark Keitel 12-05 // Van K Tharp Efficient Stocks GfxSelectFont ( "Arial" , 8, 500, True ); ATRD180 = ATR (180); ATRD90 = ATR (90); ATRD45 = ATR (45); ATRD20 = ATR (20); ATRD5 = ATR (5); DifferenceD180 = Close - Ref ( Close ,-180); DifferenceD90 = Close - Ref ( Close ,-90); DifferenceD45 = Close - Ref ( Close ,-45); DifferenceD20 = Close - Ref ( Close ,-20); DifferenceD5 = Close - Ref ( Close ,-5); EfficiencyD180 = IIf (ATRD180!=0,DifferenceD180/ATRD180,1); EfficiencyD90 = IIf (ATRD90!=0,DifferenceD90/ATRD90,1); EfficiencyD45 = IIf (ATRD45!=0,DifferenceD45/ATRD45,1); EfficiencyD20 = IIf (ATRD20!=0,DifferenceD20/ATRD20,1); EfficiencyD5 = IIf (ATRD5!=0,DifferenceD5/ATRD5,1); Averageeff = (EfficiencyD180 + EfficiencyD90 + EfficiencyD45 + EfficiencyD20 ) / 4; //Plot( averageeff, "AvgEff", colorLightBlue, styleLine ); x = Param ( "Add Results to a Watchlist? Yes = 1, No = 2" , 2 , 1 , 2 , 1 ) ; // select whether to add results to watchlist or not y = Param ( "Set Watchlist Number" , 25, 2, 60,1); // sets the watchlist number, but reserves the first 2 and last 4 watchlists // -------- Parameter Variables for Exploration -------------------------------- TCH = Param ( "High close value " , 20, 5, 300, 0.5); TCL = Param ( "Low close value " , 5, 1, 10, 0.25); AVP = Param ( "Period for Avg Vol " , 21, 10, 240, 1); SV = Param ( "Stock minimum Avg Vol " , 125000, 50000, 1000000, 500000); // -------------- Organize the exploration results ------------------------------------ P = Param ( "Period for Price Delta Comparisons" , 1, 1, 120, 1); P1 = Param ( "Period for Other Delta Comparisons" , 3, 1, 120, 1); PATR = Param ( "Period for ATR" , 5,1,21,1); PADX = Param ( "Period for ADX" , 14, 3, 34,1); PRSI = Param ( "Period for RSI" , 13, 3, 34,1); ADX_TREND = WriteIf ( PDI (PADX)> MDI (PADX), "_ TREND UP" , "_TREND DOWN" ); GfxSetTextColor ( colorRed ); GfxTextOut ( "RSI(14) = " + MOMETUM + ADX_TREND , textoffset + 1,465 ); ADX_14 = ADX (14); GfxSetTextColor ( colorLightBlue ); GfxTextOut ( "ADX_TREND = " +ADX_14+ ADX_TREND, textoffset + 1, 452 ); _SECTION_END (); _SECTION_BEGIN ( "Gann HiLo" ); /*Gann HiLo*/ pds= Param ( "Stop Period" ,4,2,10,0.25); barcolor= IIf ( Outside (), colorYellow , IIf ( L < Ref ( L ,-1) && H <= Ref ( H ,-1), colorRed , IIf ( H > Ref ( H ,-1) && L >= Ref ( L ,-1), colorBrightGreen , colorBlue ))); Hld = IIf ( C > Ref ( MA ( H , 2), -1), 1, IIf ( C < Ref ( MA ( L , 2), -1), -1, 0)); Hlv = ValueWhen (Hld != 0, Hld, 1); Hilo = IIf (Hlv == -1, MA ( H , 2), MA ( L , 2)); Trigger = IIf ( C >Hilo, colorBrightGreen , colorRed ); Buy = Close > Hilo; Sell = Close < Hilo; GannHiLo = WriteIf ( C >Hilo, "BUY" , "SELL" ); GfxSetTextColor ( colorBrightGreen ); GfxTextOut ( "GannHiLo = " +GannHiLo, textoffset + 1, 255 ); GfxSelectFont ( "Arial" , 8 ); _SECTION_END (); _SECTION_BEGIN ( "Indicator ZeroLag W%R" ); /*ZeroLag W%R*/ "========" ; R = (( HHV ( H ,12) - C ) /( HHV ( H ,14) - LLV ( L ,14))) *-100; Period= 10; EMA1= EMA (R,Period); EMA2= EMA (EMA1,5); Difference= EMA1 - EMA2; ZeroLagEMA= EMA1 + Difference; PR=100- abs (ZeroLagEMA); Buy = Cross (R,ZeroLagEMA); Sell = Cross (ZeroLagEMA,R); ZeroLagEMA = WriteIf (R > ZeroLagEMA, "BUY" , "SELL" ); GfxSetTextColor ( colorOrange ); GfxTextOut ( "William%R = " +ZeroLagEMA, textoffset + 1, 216 ); GfxSelectFont ( "Arial" , 8 ); _SECTION_END (); _SECTION_BEGIN ( "PVR" ); "PVR" ; P1= Ref ( C ,-1); V1= Ref ( V ,-1); PVR= IIf ( C >P1 AND V >V1,4, IIf ( C >P1 AND V <V1,3, IIf ( C <P1 AND V <V1,2,1))); GraphXSpace =10; A= EMA (PVR,5); B= EMA (A,3); Buy = Cross (A, B); Sell = Cross (B, A); PVR = WriteIf (A > B, "BUY" , "SELL" ); GfxSetTextColor ( colorRed ); GfxTextOut ( "PVR = " +PVR, textoffset + 1, 203 ); GfxSelectFont ( "Arial" , 8 ); _SECTION_END (); _SECTION_BEGIN ( "ASHISHDA MACD" ); a= TSF ( C ,3)+ TSF ( C ,5)+ TSF ( C ,8)+ TSF ( C ,13)+ TSF ( C ,17)+ TSF ( C ,26); b= TSF ( C ,8)+ TSF ( C ,13)+ TSF ( C ,26)+ TSF ( C ,35)+ TSF ( C ,50)+ TSF ( C ,56); mova= TSF (a,3); movb= TSF (b,26); diff= a + mova; diff1= b + movb; m= diff - diff1; m1= TSF (m,5)*.5; Buy = Cross (m1, Ref (m1, -1)); Sell = Cross ( Ref (m1, -1),m1); QuickMACD = WriteIf (m1> Ref (m1, -1), "BUY" , "SELL" ); GfxSetTextColor ( colorGreen ); GfxTextOut ( "MACD = " +QuickMACD, textoffset + 1, 242 ); GfxSelectFont ( "Arial" , 8 ); _SECTION_END (); _SECTION_BEGIN ( "SECONDARY LANDIS" ); x = (( StochK (9,3)*0.05)+( StochK (182,9)*0.43)+( StochK (34,13)*0.26)+( StochK (34,8)*0.16)+( StochK (21,5)*0.10)); y = MA (x,15); Buy = Cross (x,y); Sell = Cross (y,x); LANDIS = WriteIf (x > y, "SECONDARY UPTREND" , "SECONDARY DOWNTREND" ); GfxSetTextColor ( colorPink ); GfxTextOut ( "LANDIS = " +LANDIS, textoffset + 1, 491 ); GfxSelectFont ( "Arial" , 8 ); //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx _SECTION_BEGIN ( "Average" ); P = ParamField ( "Field" ); Type = ParamList ( "Type" , "Weighted,Lagless-21,Hull-26,Linear Regression-45,Exponential,Double Exponential,Tripple Exponential,Wilders,Simple" ); Periods = Param ( "Periods" , 14, 2, 100 ); Displacement = Param ( "Displacement" , 1, -50, 50 ); m = 0; if ( Type == "Weighted" ) m= WMA ( P, Periods ); if ( Type == "Lagless-21" ) m= 2* EMA (P, Periods)- EMA ( EMA (P, Periods), Periods); if ( Type == "Hull-26" ) m= WMA (2*( WMA (P, Periods/2))- WMA (P, Periods) ,4 ); if ( Type == "Linear Regression-45" ) m= LinearReg ( P, Periods ); if ( Type == "Exponential" ) m = EMA ( P, Periods ); if ( Type == "Double Exponential" ) m = DEMA ( P, Periods ); if ( Type == "Tripple Exponential" ) m = TEMA ( P, Periods ); if ( Type == "Wilders" ) m = Wilders ( P, Periods ); if ( Type == "Simple" ) m = MA ( P, Periods ); Buy = Cover = Cross ( C ,m); Sell = Short = Cross (m, C ); AveragePrice = WriteIf ( C > m, "ABOVE AVERAGE" , "BELOW AVERAGE" ); GfxSetTextColor ( colorDarkYellow ); GfxTextOut ( "PRICE = " +averageprice, textoffset + 1, 504 ); GfxSelectFont ( "Arial" , 8 ); _SECTION_BEGIN ( "SAR ARROW" ); Plot ( Close , "C" , colorBlack , styleCandle ); acc = Param ( "Acceleration" , 0.02, 0, 1, 0.001 ); accm = Param ( "Max. acceleration" , 0.2, 0, 1, 0.001 ); S = SAR (); Buy = Cross ( Close , S ); Sell = Cross ( S, Close ); SARPhase = WriteIf ( Close >S, "BUY" , "SELL" ); GfxSetTextColor ( colorRed ); GfxTextOut ( "S A R = " +SARPhase, textoffset + 1, 517 ); GfxSelectFont ( "Arial" , 8 ); _SECTION_END (); _SECTION_BEGIN ( "Stochastic Momentum Index" ); period1 = 12; period2 = 6; period3 = 6; SMI = 100 * ( EMA ( EMA ( C - (0.5 * ( HHV ( H ,period1) + LLV ( L ,period1))),period2),period3)/(0.5* EMA ( EMA ( HHV ( H ,period1) - LLV ( L ,period1),period2),period3))); Buy = Cross (SMI, MA ( SMI, 6 )); Sell = Cross ( MA ( SMI, 6 ),SMI); Momentum = WriteIf (SMI > MA ( SMI, 6 ), "BUY" , "SELL" ); GfxSetTextColor ( colorOrange ); GfxTextOut ( "Stoch Momentum = " +Momentum, textoffset + 1, 530 ); GfxSelectFont ( "Arial" , 8 ); _SECTION_END (); _SECTION_BEGIN ( "JMAHiLo" ); function JMA( array, per ) { TN1= MA (array,per); s1=0; for ( i = 0; i < per; i=i+1 ) { s1=s1+((per-(2*i)-1)/2)* Ref (array,-i); } return TN1+(((per/2)+1)*S1)/((per+1)*per); } JMAperiods = Param ( "JMA Periods" , 10, 1, 200, 1 ); _SECTION_BEGIN ( "RWIHILO" ); minperiods = Param ( "Min Periods" , 2, 1, 200, 1 ); maxperiods = Param ( "Max Periods" , 8, 1, 200, 1 ); varLo = RWILo ( minperiods, maxperiods); minperiods = Param ( "Min Periods" , 2, 1, 200, 1 ); maxperiods = Param ( "Max Periods" , 8, 1, 200, 1 ); varHi = RWIHi ( minperiods, maxperiods) ; Buy = Cross (JMA(varHi ,JMAperiods),JMA(varLo ,JMAperiods)); Sell = Cross (JMA(varLo ,JMAperiods),JMA(varHi ,JMAperiods)); JMAHiLo = WriteIf (JMA(varHi ,JMAperiods) > JMA(varLo ,JMAperiods), "BUY" , "SELL" ); GfxSetTextColor ( colorGreen ); GfxTextOut ( "JMAHiLo = " +JMAHiLo, textoffset + 1, 543 ); GfxSelectFont ( "Arial" , 8 ); _SECTION_END (); _SECTION_BEGIN ( "SmoothHeikin MA Swing" ); SetBarsRequired (200,0); GraphXSpace = 5; SetChartOptions (0, chartShowArrows | chartShowDates ); k = Param ( "K" , 1.5, 1, 5, 0.1); Per = Param ( "ATR" , 3, 1, 30, 0.50); k1 = Optimize ( "K" , 1, 0.1, 5, 0.1); Per1 = Optimize ( "ATR" , 3, 1, 30, 0.50); HACLOSE=( O + H + L + C )/4; HaOpen = AMA ( Ref ( HaClose, -1 ), 0.5 ); HaHigh = Max ( H , Max ( HaClose, HaOpen ) ); HaLow = Min ( L , Min ( HaClose, HaOpen ) ); j=Haclose; //======================================================================================================================= //=========================Indicator============================================================================================== f= ATR (14); rfsctor = WMA ( H - L , Per); revers = k * rfsctor; Trend = 1; NW[0] = 0; for (i = 1; i < BarCount ; i++) { if (Trend[i-1] == 1) { if (j[i] < NW[i-1]) { Trend[i] = -1; NW[i] = j[i] + Revers[i]; } else { Trend[i] = 1; if ((j[i] - Revers[i]) > NW[i-1]) { NW[i] = j[i] - Revers[i]; } else { NW[i] = NW[i-1]; } } } if (Trend[i-1] == -1) { if (j[i] > NW[i-1]) { Trend[i] = 1; NW[i] = j[i] - Revers[i]; } else { Trend[i] = -1; if ((j[i] + Revers[i]) < NW[i-1]) { NW[i] = j[i] + Revers[i]; } else { NW[i] = NW[i-1]; } } } } //===============system================ Plot (NW, "" , IIf (Trend == 1, 3, 25), 1); Buy = Cover = Cross (j,nw); Sell = Short = Cross (nw,j); SWING = WriteIf (j > nw, "UPTREND" , "DOWNTREND" ); GfxSetTextColor ( colorLightBlue ); GfxTextOut ( "SWING = " +SWING, textoffset + 1, 268 ); GfxSelectFont ( "Arial" , 8 ); shape = Buy * shapeCircle + Sell * shapeCircle ; _SECTION_END (); _SECTION_BEGIN ( "Sigma Bands" ); A = Param ( "Periods?" ,21,1,300,1); x = MA ( C ,a); x1 = x+1* StDev ( C ,a); x2 = x+2* StDev ( C ,a); x3 = x+3* StDev ( C ,a); y1 = x-1* StDev ( C ,a); y2 = x-2* StDev ( C ,a); y3 = x-3* StDev ( C ,a); Plot (x1, "" , colorDarkGreen , styleDashed ); Plot (x2, "" , colorDarkGreen , styleThick | styleDashed ); Plot (x3, "" , colorDarkGreen , styleThick ); Plot (y1, "" , colorDarkRed , styleDashed ); Plot (y2, "" , colorDarkRed , styleThick | styleDashed ); Plot (y3, "" , colorDarkRed , styleThick ); _SECTION_END (); _SECTION_BEGIN ( "Pivot_Finder" ); /* ********************************** Code to automatically identify pivots ********************************** */ // -- what will be our lookback range for the hh and ll? farback= Param ( "How Far back to go" ,100,0,5000,10); nBars = Param ( "Number of bars" , 12, 5, 40); GraphXSpace =7; // -- Create 0-initialized arrays the size of barcount aHPivs = H - H ; aLPivs = L - L ; // -- More for future use, not necessary for basic plotting aHPivHighs = H - H ; aLPivLows = L - L ; aHPivIdxs = H - H ; aLPivIdxs = L - L ; nHPivs = 0; nLPivs = 0; lastHPIdx = 0; lastLPIdx = 0; lastHPH = 0; lastLPL = 0; curPivBarIdx = 0; // -- looking back from the current bar, how many bars // back were the hhv and llv values of the previous // n bars, etc.? aHHVBars = HHVBars ( H , nBars); aLLVBars = LLVBars ( L , nBars); aHHV = HHV ( H , nBars); aLLV = LLV ( L , nBars); // -- Would like to set this up so pivots are calculated back from // last visible bar to make it easy to "go back" and see the pivots // this code would find. However, the first instance of // _Trace output will show a value of 0 aVisBars = Status ( "barvisible" ); nLastVisBar = LastValue ( Highest ( IIf (aVisBars, BarIndex (), 0))); _TRACE ( "Last visible bar: " + nLastVisBar); // -- Initialize value of curTrend curBar = ( BarCount -1); curTrend = "" ; if (aLLVBars[curBar] < aHHVBars[curBar]) { curTrend = "D" ; } else { curTrend = "U" ; } // -- Loop through bars. Search for // entirely array-based approach // in future version for (i=0; i<farback; i++) { curBar = ( BarCount - 1) - i; // -- Have we identified a pivot? If trend is down... if (aLLVBars[curBar] < aHHVBars[curBar]) { // ... and had been up, this is a trend change if (curTrend == "U" ) { curTrend = "D" ; // -- Capture pivot information curPivBarIdx = curBar - aLLVBars[curBar]; aLPivs[curPivBarIdx] = 1; aLPivLows[nLPivs] = L [curPivBarIdx]; aLPivIdxs[nLPivs] = curPivBarIdx; nLPivs++; } // -- or current trend is up } else { if (curTrend == "D" ) { curTrend = "U" ; curPivBarIdx = curBar - aHHVBars[curBar]; aHPivs[curPivBarIdx] = 1; aHPivHighs[nHPivs] = H [curPivBarIdx]; aHPivIdxs[nHPivs] = curPivBarIdx; nHPivs++; } // -- If curTrend is up...else... } // -- loop through bars } // -- Basic attempt to add a pivot this logic may have missed // -- OK, now I want to look at last two pivots. If the most // recent low pivot is after the last high, I could // still have a high pivot that I didn't catch // -- Start at last bar curBar = ( BarCount -1); candIdx = 0; candPrc = 0; lastLPIdx = aLPivIdxs[0]; lastLPL = aLPivLows[0]; lastHPIdx = aHPivIdxs[0]; lastHPH = aHPivHighs[0]; if (lastLPIdx > lastHPIdx) { // -- Bar and price info for candidate pivot candIdx = curBar - aHHVBars[curBar]; candPrc = aHHV[curBar]; if ( lastHPH < candPrc AND candIdx > lastLPIdx AND candIdx < curBar) { // -- OK, we'll add this as a pivot... aHPivs[candIdx] = 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] = candPrc ; aHPivIdxs[0] = candIdx; nHPivs++; } } else { // -- Bar and price info for candidate pivot candIdx = curBar - aLLVBars[curBar]; candPrc = aLLV[curBar]; if ( lastLPL > candPrc AND candIdx > lastHPIdx AND candIdx < curBar) { // -- OK, we'll add this as a pivot... aLPivs[candIdx] = 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] = candPrc; aLPivIdxs[0] = candIdx; nLPivs++; } } // -- Dump inventory of high pivots for debugging for (k=0; k<nHPivs; k++) { _TRACE ( "High pivot no. " + k + " at barindex: " + aHPivIdxs[k] + ", " + WriteVal ( ValueWhen ( BarIndex ()==aHPivIdxs[k], DateTime (), 1), formatDateTime) + ", " + aHPivHighs[k]); } // -- OK, let's plot the pivots using arrows PlotShapes ( IIf (aHPivs==1, shapeHollowSquare, shapeNone ), colorRed , 0, H , 15); PlotShapes ( IIf (aLPivs==1, shapeHollowSquare , shapeNone ), colorLime , 0, L , -15); _SECTION_BEGIN ( "Graphics" ); GrpPrm= Param ( "Graphic Space" ,1,0,10); GraphXSpace =GrpPrm; _SECTION_END (); _SECTION_BEGIN ( "channels" ); //Pattern Recognition graph //with shading /*TRENDLINES BREAKOUT*/ x = Cum (1); per = Param ( "Percent" ,3,1,5,1); s1= L ; s11= H ; pS = TroughBars ( s1, per, 1 ) == 0; endt= LastValue ( ValueWhen ( pS, x, 1 )); startt= LastValue ( ValueWhen ( pS, x, 2 )); endS = LastValue ( ValueWhen ( pS, s1, 1 ) ); startS = LastValue ( ValueWhen ( pS, s1, 2 )); dtS =endt-startt; aS = (endS-startS)/dtS; bS = endS; trendlineS = aS * ( x -endt ) + bS; pR = PeakBars ( s11, per, 1 ) == 0; endt1= LastValue ( ValueWhen ( pR, x, 1 )); startt1= LastValue ( ValueWhen ( pR, x, 2 )); endR = LastValue ( ValueWhen ( pR, s11, 1 ) ); startR = LastValue ( ValueWhen ( pR, s11, 2 )); DTR=ENDT1-STARTT1; aR = (endR-startR)/dtR; bR = endR; trendlineR = aR * ( x -endt1 ) + bR; BEGIN= Min (STARTT,STARTT1); TRS = IIf (x>BEGIN-10,trendlineS,-1e10); TRR = IIf (x>BEGIN-10,trendlineR,-1e10); Condcolor=( Cross ( C ,trendlineR) AND X>ENDT1) OR ( Cross (trendlineS, C ) AND X>ENDT); BarColor= IIf (Condcolor,7,1); Plot ( C , "Close" ,BarColor, styleCandle ); Plot (TRS, "Support" , colorYellow , styleLine ); Plot (TRR, "Resist" , colorYellow , styleLine ); ///////////////////////////////////// // Shading // //////////////////////////////////// fill= Param ( "style" ,2,1,2,1); style= IIf (fill==1, styleHistogram , IIf (fill==2, styleArea , Null )); x= IIf (trs > trr,trr,trs); Plot (x, "" , colorBlack ,style); Plot (trr, "" , colorDarkTeal ,style); //////////////////////////////////////////// // Pattern Recognition in title bar // /////////////////////////////////////////// Lowline=Ends-starts; Highline=endr-startr; Wedge= IIf (Highline <0 AND Lowline > 0,1,0); DecendingTriangle= IIf (Highline < 0 AND Lowline==0,1,0); AscendingTriangle= IIf (Highline==0 AND Lowline > 0,1,0); DownChannel= IIf (Highline<0 AND Lowline<0,1,0); UpChannel= IIf (Highline>0 AND Lowline>0,1,0); BroadeningWedge= IIf (Highline > 0 AND Lowline < 0,1,0); /////////////////////////////////// // Bullish or Bearish breakout // ////////////////////////////////// BullishBreakout= Cross ( C ,trendlineR); BearishBreakout= Cross (trendlineS, C ); Breakout = WriteIf ( C > trendlineR, "Bullish" , "Bearish" ); GfxSetTextColor ( colorWhite ); GfxTextOut ( "Breakout = " +Breakout, textoffset + 1, 558 ); GfxSelectFont ( "Arial" , 8 ); Title= Name ()+ WriteIf (wedge==1, " Wedge" , "" )+ WriteIf (DecendingTriangle==1, " Decending Triangle" , "" )+ WriteIf (AscendingTriangle==1, "Ascending Triangle" , "" ) /*+WriteVal(Lowline)*/ + WriteIf (DownChannel==1, " Downward Sloping Channel" , "" )+ WriteIf (UpChannel==1, " Upward Sloping Channel" , "" )+ WriteIf (broadeningWedge==1, " Broadening Wedge" , "" )+ "\n" + EncodeColor ( colorGreen )+ WriteIf (bullishbreakout, "Bullish Breakout" , EncodeColor ( colorRed )+ WriteIf (bearishbreakout, "Bearish Breakout" , "" )) /*+WriteVal(highline)*/ ; ///////////////////////////////////// // Automatic Analysis // //////////////////////////////////// Filter =AscendingTriangle OR DecendingTriangle OR Wedge OR DownChannel OR UpChannel OR BroadeningWedge OR Bullishbreakout OR bearishbreakout; AddTextColumn ( WriteIf (bullishbreakout, "bullish Breakout" , "" ), "BullBreak" ); AddTextColumn ( WriteIf (bearishBreakout, "Bearish Breakout" , "" ), "BearBreak" ); AddTextColumn ( WriteIf (ascendingtriangle, "Ascending Triangle" , WriteIf (decendingtriangle, "Decending Triangle" , WriteIf (Wedge, "Wedge" , WriteIf (DownChannel, "Down Channel" , WriteIf (UpChannel, "Up Channel" , WriteIf (BroadeningWedge, "Broadening Wedge" , "" )))))), "Pattern" ); _SECTION_END (); _SECTION_BEGIN ( "Calculation Bar" ); Version (4.70); // needs AmiBroker 4.70 function msPattPos( element ) { Value1 = Ref ( H , -1 ); Value2 = Ref ( L , -1 ); Value3 = ( Value1 + Value2 )/2; Dist = Ref ( ATR ( 10 ), -1 ); Value4 = Value1 + Dist; Value5 = Value2 - Dist; result = IIf ( element < Value5, 0, IIf ( element < Value2, 1, IIf ( element < Value3, 2, IIf ( element < Value1, 3, IIf ( element < Value4, 4, 5 ) ) ) ) ); return result; } function msPattToText( patt ) { result = WriteIf ( patt == 0, " is below previous (Low - ATR 10) " , WriteIf ( patt == 1, " is above (at) previous (Low - ATR 10) and below previous Low " , WriteIf ( patt == 2, " is above (at) previous Low and below previous Midpoint " , WriteIf ( patt == 3, " is above (at) previous Midpoint and below previous High " , WriteIf ( patt == 4, " is above (at) previous High and below (High + ATR 10) " , " is above (at) previous (High + ATR(10) " ) ) ) ) ); return result; } function msRecognize() { return 1000 * msPattPos( Open ) + 100 * msPattPos( High ) + 10 * msPattPos( Low ) + msPattPos( Close ); } function msPatternDescription( patt ) { return "Open: " + msPattToText( round ( ( patt / 1000 ) % 10 ) ) + "\n" + "High: " + msPattToText( round ( ( patt / 100 ) % 10 ) ) + "\n" + "Low: " + msPattToText( round ( ( patt / 10 ) % 10 ) ) + "\n" + "Close: " + msPattToText( round ( patt % 10 ) ); } patts = msRecognize(); // by default use pattern occuring at selected bar DesiredPattern = SelectedValue ( patts ); // if you want manual-entry of pattern code from parameter dialog // then uncomment the line below //DesiredPattern=Param("Pattern to look for", 3434, 0, 5555, 0 ); Title = StrFormat ( "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g" , O , H , L , C ); Title = Title + "\nPattern code is : " + DesiredPattern + "\n" + msPatternDescription( DesiredPattern ); //Plot(C, "Price", ParamColor("Color", colorGrey40), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); PattCloseAbove = DesiredPattern == patts AND Ref ( Close > Open , 1 ); PattCloseBelow = DesiredPattern == patts AND Ref ( Close < Open , 1 ); //PlotShapes( ( DesiredPattern == patts ) * shapeCircle , IIf( PattCloseAbove, colorDarkGreen, IIf( PattCloseBelow, colorDarkRed, colorDarkBlue ) ), 0, High, 30 ); NumPatterns = LastValue ( Cum ( DesiredPattern == patts ) ); NumPattCloseAbove = LastValue ( Cum ( PattCloseAbove ) ); NumPattCloseBelow = LastValue ( Cum ( PattCloseBelow ) ); NumPattCloseEqual = NumPatterns - NumPattCloseAbove - NumPattCloseBelow; Title = Title + "\n\nTotal number of Patterns: " + NumPatterns + "\n% on Total Bars: " + 100 * NumPatterns/ BarCount + "\nIn the next bar\n" + EncodeColor ( colorGreen ) + "Close has been above the open " + NumPattCloseAbove + " (" + NumPattCloseAbove / NumPatterns + "%) times\n" + EncodeColor ( colorRed ) + "Close has been below the open " + NumPattCloseBelow + " (" + NumPattCloseBelow / NumPatterns + " %) times\n" + EncodeColor ( colorGrey50 ) + "Close has been equal to the open " + NumPattCloseEqual + " (" + NumPattCloseEqual / NumPatterns + " %)times" ; _SECTION_END (); |
24 comments
Leave Comment
Please login here to leave a comment.
Back
interesting afl.
anyone can add codes for exploration ?
getting error
Thanks a lot Isfandi Brother.
Somebody explain this AFL plz…
Dear Isfandi and ADMIN, am very much like to use this AFL, but am seeing some syntex error, pls followup the error.. am using AMI 5…am waiting ur valuable reply..thx..
Hi Guys.. please instal complete PLUGINS first before use my system
http://www.4shared.com/file/0eIUPRdZ/Plugins.html
Thank you.
Thank you very much , great one, I have problem , to see one hour chart,,other wise 5min, 15,min is too good,
plz add me to your messeger yahoo. ma80rao Help me with one hour chart
regards
Rani
great one , thanks.
- — -
good one….
Sorry, the link is expired. Anyone can upload again ? Plz
super
Are signals coming in realtime? Does this AFL have disappearing signals? ( because back testing is not there, so I doubt… )
i try to download plugin but get error please give me any other source or correct link nagartrilok@gmail.com
good
Noted the request for the Plugins. Here they are, uploaded 01 Mar 2015. Remember that the file may be deleted later by the 4shared server. This is not under my control.
http://www.4shared.com/zip/msyH4Gy9ce/Isfandi_afl_Plugins_1736.html
Enjoy. * Parfumeur *can i have the plugin for this afl please..since the link below has expired..thank you
Hello,
You will find the plugins needed here..
hi
thank’s alot..ill try it now..
dear administrator
if im trying to scan with isfandi trading system II afl, there will be an error.
error 10 Array subcrict out of range, you must not access array elements outside 0 (bar count-1).
this line
if (aLLVBars[curBar] < aHHVBars[curBar]) {
could you help me how to fix it please? thank you
@teta I have tested the indicator and havn’t seen the problem you described.
dear admin
just solved the problem…it doesnt work with all stocks. So i need to make watchlist.
thank you
@teta
sir can you please name some stocks it will probably work on ??
thanks