QuantumLearner commited on
Commit
6838253
·
verified ·
1 Parent(s): ae2f455

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +546 -513
app.py CHANGED
@@ -503,537 +503,585 @@ if 'data' in st.session_state:
503
  )
504
 
505
  # EMA with tooltip
506
- use_ema = st.sidebar.checkbox(
507
- 'Exponential Moving Average (EMA)',
508
- value=st.session_state.get('use_ema', False),
509
- help="Select to apply Exponential Moving Average (EMA) to the stock price."
510
- )
511
- ema_period = st.sidebar.number_input(
512
- 'EMA Period',
513
- min_value=1,
514
- value=st.session_state.get('ema_period', 50),
515
- step=1,
516
- disabled=not use_ema,
517
- help="Specify the period (in days) for the EMA."
518
- )
519
-
 
520
  # WMA with tooltip
521
- use_wma = st.sidebar.checkbox(
522
- 'Weighted Moving Average (WMA)',
523
- value=st.session_state.get('use_wma', False),
524
- help="Select to apply Weighted Moving Average (WMA) to the stock price."
525
- )
526
- wma_period = st.sidebar.number_input(
527
- 'WMA Period',
528
- min_value=1,
529
- value=st.session_state.get('wma_period', 50),
530
- step=1,
531
- disabled=not use_wma,
532
- help="Specify the period (in days) for the WMA."
533
- )
534
-
 
535
  # DEMA with tooltip
536
- use_dema = st.sidebar.checkbox(
537
- 'Double Exponential Moving Average (DEMA)',
538
- value=st.session_state.get('use_dema', False),
539
- help="Select to apply Double Exponential Moving Average (DEMA) to the stock price."
540
- )
541
- dema_period = st.sidebar.number_input(
542
- 'DEMA Period',
543
- min_value=1,
544
- value=st.session_state.get('dema_period', 50),
545
- step=1,
546
- disabled=not use_dema,
547
- help="Specify the period (in days) for the DEMA."
548
- )
549
-
 
550
  # TEMA with tooltip
551
- use_tema = st.sidebar.checkbox(
552
- 'Triple Exponential Moving Average (TEMA)',
553
- value=st.session_state.get('use_tema', False),
554
- help="Select to apply Triple Exponential Moving Average (TEMA) to the stock price."
555
- )
556
- tema_period = st.sidebar.number_input(
557
- 'TEMA Period',
558
- min_value=1,
559
- value=st.session_state.get('tema_period', 50),
560
- step=1,
561
- disabled=not use_tema,
562
- help="Specify the period (in days) for the TEMA."
563
- )
564
-
 
565
  # VAMA with tooltip
566
- use_vama = st.sidebar.checkbox(
567
- 'Volume-Adjusted Moving Average (VAMA)',
568
- value=st.session_state.get('use_vama', False),
569
- help="Select to apply Volume-Adjusted Moving Average (VAMA) to the stock price."
570
- )
571
- vama_period = st.sidebar.number_input(
572
- 'VAMA Period',
573
- min_value=1,
574
- value=st.session_state.get('vama_period', 50),
575
- step=1,
576
- disabled=not use_vama,
577
- help="Specify the period (in days) for the VAMA."
578
- )
579
-
 
580
  # KAMA with tooltip
581
- use_kama = st.sidebar.checkbox(
582
- 'Kaufman Adaptive Moving Average (KAMA)',
583
- value=st.session_state.get('use_kama', False),
584
- help="Select to apply Kaufman Adaptive Moving Average (KAMA) to the stock price."
585
- )
586
- kama_period = st.sidebar.number_input(
587
- 'KAMA Period',
588
- min_value=1,
589
- value=st.session_state.get('kama_period', 10),
590
- step=1,
591
- disabled=not use_kama,
592
- help="Specify the efficiency ratio period (in days) for the KAMA."
593
- )
594
- fastest_period = st.sidebar.number_input(
595
- 'Fastest SC Period',
596
- min_value=1,
597
- value=st.session_state.get('fastest_period', 2),
598
- step=1,
599
- disabled=not use_kama,
600
- help="Specify the fastest smoothing constant period."
601
- )
602
- slowest_period = st.sidebar.number_input(
603
- 'Slowest SC Period',
604
- min_value=1,
605
- value=st.session_state.get('slowest_period', 30),
606
- step=1,
607
- disabled=not use_kama,
608
- help="Specify the slowest smoothing constant period."
609
- )
610
-
 
611
  # TMA with tooltip
612
- use_tma = st.sidebar.checkbox(
613
- 'Triangular Moving Average (TMA)',
614
- value=st.session_state.get('use_tma', False),
615
- help="Select to apply Triangular Moving Average (TMA) to the stock price."
616
- )
617
- tma_period = st.sidebar.number_input(
618
- 'TMA Period',
619
- min_value=1,
620
- value=st.session_state.get('tma_period', 20),
621
- step=1,
622
- disabled=not use_tma,
623
- help="Specify the period (in days) for the TMA."
624
- )
 
625
 
626
  # Hull MA with tooltip
627
- use_hull_ma = st.sidebar.checkbox(
628
- 'Hull Moving Average (HMA)',
629
- value=st.session_state.get('use_hull_ma', False),
630
- help="Select to apply Hull Moving Average (HMA) to the stock price."
631
- )
632
- hull_ma_period = st.sidebar.number_input(
633
- 'HMA Period',
634
- min_value=1,
635
- value=st.session_state.get('hull_ma_period', 120),
636
- step=1,
637
- disabled=not use_hull_ma,
638
- help="Specify the period (in days) for the Hull Moving Average."
639
- )
640
-
 
641
  # Harmonic MA with tooltip
642
- use_harmonic_ma = st.sidebar.checkbox(
643
- 'Harmonic Moving Average (HMA)',
644
- value=st.session_state.get('use_harmonic_ma', False),
645
- help="Select to apply Harmonic Moving Average (HMA) to the stock price."
646
- )
647
- harmonic_ma_period = st.sidebar.number_input(
648
- 'HMA Period',
649
- min_value=1,
650
- value=st.session_state.get('harmonic_ma_period', 120),
651
- step=1,
652
- disabled=not use_harmonic_ma,
653
- help="Specify the period (in days) for the Harmonic Moving Average."
654
- )
655
-
 
656
  # FRAMA with tooltip
657
- use_frama = st.sidebar.checkbox(
658
- 'Fractal Adaptive Moving Average (FRAMA)',
659
- value=st.session_state.get('use_frama', False),
660
- help="Select to apply Fractal Adaptive Moving Average (FRAMA) to the stock price."
661
- )
662
- frama_batch = st.sidebar.number_input(
663
- 'FRAMA Batch Size',
664
- min_value=1,
665
- value=st.session_state.get('frama_batch', 10),
666
- step=1,
667
- disabled=not use_frama,
668
- help="Specify the batch size for FRAMA calculation."
669
- )
670
-
 
671
  # ZLEMA with tooltip
672
- use_zlema = st.sidebar.checkbox(
673
- 'Zero Lag Exponential Moving Average (ZLEMA)',
674
- value=st.session_state.get('use_zlema', False),
675
- help="Select to apply Zero Lag Exponential Moving Average (ZLEMA) to the stock price."
676
- )
677
- zlema_period = st.sidebar.number_input(
678
- 'ZLEMA Period',
679
- min_value=1,
680
- value=st.session_state.get('zlema_period', 28),
681
- step=1,
682
- disabled=not use_zlema,
683
- help="Specify the period (in days) for the ZLEMA."
684
- )
685
-
 
686
  # VIDYA with tooltip
687
- use_vidya = st.sidebar.checkbox(
688
- 'Variable Index Dynamic Average (VIDYA)',
689
- value=st.session_state.get('use_vidya', False),
690
- help="Select to apply Variable Index Dynamic Average (VIDYA) to the stock price."
691
- )
692
- vidya_period = st.sidebar.number_input(
693
- 'VIDYA Period',
694
- min_value=1,
695
- value=st.session_state.get('vidya_period', 14),
696
- step=1,
697
- disabled=not use_vidya,
698
- help="Specify the period (in days) for the VIDYA."
699
- )
700
-
 
701
  # ALMA with tooltip
702
- use_alma = st.sidebar.checkbox(
703
- 'Arnaud Legoux Moving Average (ALMA)',
704
- value=st.session_state.get('use_alma', False),
705
- help="Select to apply Arnaud Legoux Moving Average (ALMA) to the stock price."
706
- )
707
- alma_period = st.sidebar.number_input(
708
- 'ALMA Period',
709
- min_value=1,
710
- value=st.session_state.get('alma_period', 36),
711
- step=1,
712
- disabled=not use_alma,
713
- help="Specify the period (in days) for the ALMA."
714
- )
715
- alma_offset = st.sidebar.number_input(
716
- 'ALMA Offset',
717
- min_value=0.0,
718
- max_value=1.0,
719
- value=st.session_state.get('alma_offset', 0.85),
720
- step=0.01,
721
- disabled=not use_alma,
722
- help="Specify the offset for the ALMA (0 to 1)."
723
- )
724
- alma_sigma = st.sidebar.number_input(
725
- 'ALMA Sigma',
726
- min_value=1,
727
- value=st.session_state.get('alma_sigma', 6),
728
- step=1,
729
- disabled=not use_alma,
730
- help="Specify the sigma for the ALMA."
731
- )
732
-
 
733
  # MAMA and FAMA with tooltip
734
- use_mama_fama = st.sidebar.checkbox(
735
- 'MESA Adaptive Moving Average (MAMA) & FAMA',
736
- value=st.session_state.get('use_mama_fama', False),
737
- help="Select to apply MESA Adaptive Moving Average (MAMA) and Following Adaptive Moving Average (FAMA) to the stock price."
738
- )
739
- mama_fast_limit = st.sidebar.number_input(
740
- 'MAMA Fast Limit',
741
- min_value=0.0,
742
- max_value=1.0,
743
- value=st.session_state.get('mama_fast_limit', 0.5),
744
- step=0.01,
745
- disabled=not use_mama_fama,
746
- help="Specify the fast limit for MAMA (0 to 1)."
747
- )
748
- mama_slow_limit = st.sidebar.number_input(
749
- 'MAMA Slow Limit',
750
- min_value=0.0,
751
- max_value=1.0,
752
- value=st.session_state.get('mama_slow_limit', 0.05),
753
- step=0.01,
754
- disabled=not use_mama_fama,
755
- help="Specify the slow limit for MAMA (0 to 1)."
756
- )
 
757
 
758
  # APMA with tooltip
759
- use_apma = st.sidebar.checkbox(
760
- 'Adaptive Period Moving Average (APMA)',
761
- value=st.session_state.get('use_apma', False),
762
- help="Select to apply Adaptive Period Moving Average (APMA) to the stock price."
763
- )
764
- apma_min_period = st.sidebar.number_input(
765
- 'APMA Min Period',
766
- min_value=1,
767
- value=st.session_state.get('apma_min_period', 5),
768
- step=1,
769
- disabled=not use_apma,
770
- help="Specify the minimum period for the APMA."
771
- )
772
- apma_max_period = st.sidebar.number_input(
773
- 'APMA Max Period',
774
- min_value=1,
775
- value=st.session_state.get('apma_max_period', 30),
776
- step=1,
777
- disabled=not use_apma,
778
- help="Specify the maximum period for the APMA."
779
- )
780
-
 
781
  # Rainbow EMA with tooltip
782
- use_rainbow_ema = st.sidebar.checkbox(
783
- 'Rainbow Moving Average (EMA)',
784
- value=st.session_state.get('use_rainbow_ema', False),
785
- help="Select to apply Rainbow Moving Average (EMA) with multiple lookback periods to the stock price."
786
- )
787
- rainbow_lookback_periods = st.sidebar.multiselect(
788
- 'Rainbow Lookback Periods',
789
- options=[2, 4, 8, 16, 32, 64, 128, 192, 320, 512],
790
- default=st.session_state.get('rainbow_lookback_periods', [2, 4, 8, 16, 32, 64, 128]),
791
- disabled=not use_rainbow_ema,
792
- help="Select multiple lookback periods for the Rainbow EMA."
793
- )
794
-
 
795
  # Wilders MA with tooltip
796
- use_wilders_ma = st.sidebar.checkbox(
797
- 'Wilders Moving Average (Wilder\'s MA)',
798
- value=st.session_state.get('use_wilders_ma', False),
799
- help="Select to apply Wilder's Moving Average to the stock price."
800
- )
801
- wilders_ma_period = st.sidebar.number_input(
802
- 'Wilders MA Period',
803
- min_value=1,
804
- value=st.session_state.get('wilders_ma_period', 14),
805
- step=1,
806
- disabled=not use_wilders_ma,
807
- help="Specify the period (in days) for Wilder's Moving Average."
808
- )
809
-
 
810
  # SMMA with tooltip
811
- use_smma = st.sidebar.checkbox(
812
- 'Smoothed Moving Average (SMMA)',
813
- value=st.session_state.get('use_smma', False),
814
- help="Select to apply Smoothed Moving Average (SMMA) to the stock price."
815
- )
816
- smma_period = st.sidebar.number_input(
817
- 'SMMA Period',
818
- min_value=1,
819
- value=st.session_state.get('smma_period', 28),
820
- step=1,
821
- disabled=not use_smma,
822
- help="Specify the period (in days) for the SMMA."
823
- )
824
-
 
825
  # GMMA with tooltip
826
- use_gmma = st.sidebar.checkbox(
827
- 'Guppy Multiple Moving Average (GMMA)',
828
- value=st.session_state.get('use_gmma', False),
829
- help="Select to apply Guppy Multiple Moving Average (GMMA) to the stock price."
830
- )
831
- gmma_short_periods = st.sidebar.multiselect(
832
- 'GMMA Short Periods',
833
- options=[3, 5, 8, 10, 12, 15],
834
- default=st.session_state.get('gmma_short_periods', [3, 5, 8, 10, 12, 15]),
835
- disabled=not use_gmma,
836
- help="Select the short-term periods for GMMA."
837
- )
838
- gmma_long_periods = st.sidebar.multiselect(
839
- 'GMMA Long Periods',
840
- options=[30, 35, 40, 45, 50, 60],
841
- default=st.session_state.get('gmma_long_periods', [30, 35, 40, 45, 50, 60]),
842
- disabled=not use_gmma,
843
- help="Select the long-term periods for GMMA."
844
- )
845
-
 
846
  # LSMA with tooltip
847
- use_lsma = st.sidebar.checkbox(
848
- 'Least Squares Moving Average (LSMA)',
849
- value=st.session_state.get('use_lsma', False),
850
- help="Select to apply Least Squares Moving Average (LSMA) to the stock price."
851
- )
852
- lsma_period = st.sidebar.number_input(
853
- 'LSMA Period',
854
- min_value=1,
855
- value=st.session_state.get('lsma_period', 28),
856
- step=1,
857
- disabled=not use_lsma,
858
- help="Specify the period (in days) for the LSMA."
859
- )
860
-
 
861
  # MMA (Welch's MMA) with tooltip
862
- use_mma = st.sidebar.checkbox(
863
- 'Welch\'s Moving Average (MMA)',
864
- value=st.session_state.get('use_mma', False),
865
- help="Select to apply Welch\'s Moving Average (Modified Moving Average) to the stock price."
866
- )
867
- mma_period = st.sidebar.number_input(
868
- 'MMA Period',
869
- min_value=1,
870
- value=st.session_state.get('mma_period', 14),
871
- step=1,
872
- disabled=not use_mma,
873
- help="Specify the period (in days) for the MMA."
874
- )
875
-
 
876
  # SinWMA with tooltip
877
- use_sinwma = st.sidebar.checkbox(
878
- 'Sin-weighted Moving Average (SinWMA)',
879
- value=st.session_state.get('use_sinwma', False),
880
- help="Select to apply Sin-weighted Moving Average (SinWMA) to the stock price."
881
- )
882
- sinwma_period = st.sidebar.number_input(
883
- 'SinWMA Period',
884
- min_value=1,
885
- value=st.session_state.get('sinwma_period', 21),
886
- step=1,
887
- disabled=not use_sinwma,
888
- help="Specify the period (in days) for the SinWMA."
889
- )
890
-
 
891
  # MedMA with tooltip
892
- use_medma = st.sidebar.checkbox(
893
- 'Median Moving Average (MedMA)',
894
- value=st.session_state.get('use_medma', False),
895
- help="Select to apply Median Moving Average (MedMA) to the stock price."
896
- )
897
- medma_period = st.sidebar.number_input(
898
- 'MedMA Period',
899
- min_value=1,
900
- value=st.session_state.get('medma_period', 20),
901
- step=1,
902
- disabled=not use_medma,
903
- help="Specify the period (in days) for the MedMA."
904
- )
905
-
 
906
  # GMA with tooltip
907
- use_gma = st.sidebar.checkbox(
908
- 'Geometric Moving Average (GMA)',
909
- value=st.session_state.get('use_gma', False),
910
- help="Select to apply Geometric Moving Average (GMA) to the stock price."
911
- )
912
- gma_period = st.sidebar.number_input(
913
- 'GMA Period',
914
- min_value=1,
915
- value=st.session_state.get('gma_period', 20),
916
- step=1,
917
- disabled=not use_gma,
918
- help="Specify the period (in days) for the GMA."
919
- )
920
-
 
921
  # eVWMA with tooltip
922
- use_evwma = st.sidebar.checkbox(
923
- 'Elastic Volume Weighted Moving Average (eVWMA)',
924
- value=st.session_state.get('use_evwma', False),
925
- help="Select to apply Elastic Volume Weighted Moving Average (eVWMA) to the stock price."
926
- )
927
- evwma_period = st.sidebar.number_input(
928
- 'eVWMA Period',
929
- min_value=1,
930
- value=st.session_state.get('evwma_period', 20),
931
- step=1,
932
- disabled=not use_evwma,
933
- help="Specify the period (in days) for the eVWMA."
934
- )
 
935
 
936
  # REMA with tooltip
937
- use_rema = st.sidebar.checkbox(
938
- 'Regularized Exponential Moving Average (REMA)',
939
- value=st.session_state.get('use_rema', False),
940
- help="Select to apply Regularized Exponential Moving Average (REMA) to the stock price."
941
- )
942
- rema_alpha = st.sidebar.number_input(
943
- 'REMA Alpha',
944
- min_value=0.0,
945
- max_value=1.0,
946
- value=st.session_state.get('rema_alpha', 0.1),
947
- step=0.01,
948
- disabled=not use_rema,
949
- help="Specify the alpha value for the REMA (0 to 1)."
950
- )
951
- rema_lambda = st.sidebar.number_input(
952
- 'REMA Lambda',
953
- min_value=0.0,
954
- max_value=1.0,
955
- value=st.session_state.get('rema_lambda', 0.1),
956
- step=0.01,
957
- disabled=not use_rema,
958
- help="Specify the lambda value for the REMA (0 to 1)."
959
- )
960
-
 
961
  # PWMA with tooltip
962
- use_pwma = st.sidebar.checkbox(
963
- 'Parabolic Weighted Moving Average (PWMA)',
964
- value=st.session_state.get('use_pwma', False),
965
- help="Select to apply Parabolic Weighted Moving Average (PWMA) to the stock price."
966
- )
967
- pwma_period = st.sidebar.number_input(
968
- 'PWMA Period',
969
- min_value=1,
970
- value=st.session_state.get('pwma_period', 14),
971
- step=1,
972
- disabled=not use_pwma,
973
- help="Specify the period (in days) for the PWMA."
974
- )
975
-
 
976
  # JMA with tooltip
977
- use_jma = st.sidebar.checkbox(
978
- 'Jurik Moving Average (JMA)',
979
- value=st.session_state.get('use_jma', False),
980
- help="Select to apply Jurik Moving Average (JMA) to the stock price."
981
- )
982
- jma_period = st.sidebar.number_input(
983
- 'JMA Period',
984
- min_value=1,
985
- value=st.session_state.get('jma_period', 28),
986
- step=1,
987
- disabled=not use_jma,
988
- help="Specify the period (in days) for the JMA."
989
- )
990
- jma_phase = st.sidebar.number_input(
991
- 'JMA Phase',
992
- min_value=-100.0,
993
- max_value=100.0,
994
- value=st.session_state.get('jma_phase', 0.0),
995
- step=0.1,
996
- disabled=not use_jma,
997
- help="Specify the phase for the JMA (-100 to 100)."
998
- )
999
-
 
1000
  # EPMA with tooltip
1001
- use_epma = st.sidebar.checkbox(
1002
- 'End Point Moving Average (EPMA)',
1003
- value=st.session_state.get('use_epma', False),
1004
- help="Select to apply End Point Moving Average (EPMA) to the stock price."
1005
- )
1006
- epma_period = st.sidebar.number_input(
1007
- 'EPMA Period',
1008
- min_value=1,
1009
- value=st.session_state.get('epma_period', 28),
1010
- step=1,
1011
- disabled=not use_epma,
1012
- help="Specify the period (in days) for the EPMA."
1013
- )
1014
-
 
1015
  # CMA with tooltip
1016
- use_cma = st.sidebar.checkbox(
1017
- 'Chande Moving Average (CMA)',
1018
- value=st.session_state.get('use_cma', False),
1019
- help="Select to apply Chande Moving Average (CMA) to the stock price."
1020
- )
1021
- cma_period = len(data['Close'])
1022
-
 
1023
  # McGinley Dynamic with tooltip
1024
- use_mcginley_dynamic = st.sidebar.checkbox(
1025
- 'McGinley Dynamic',
1026
- value=st.session_state.get('use_mcginley_dynamic', False),
1027
- help="Select to apply McGinley Dynamic to the stock price."
1028
- )
1029
- mcginley_dynamic_period = st.sidebar.number_input(
1030
- 'McGinley Dynamic Period',
1031
- min_value=1,
1032
- value=st.session_state.get('mcginley_dynamic_period', 14),
1033
- step=1,
1034
- disabled=not use_mcginley_dynamic,
1035
- help="Specify the period (in days) for the McGinley Dynamic."
1036
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1037
 
1038
  # Anchored Moving Average (AMA) with tooltip
1039
  #use_ama = st.sidebar.checkbox(
@@ -1048,20 +1096,6 @@ if 'data' in st.session_state:
1048
  # help="Select the anchor date for the AMA."
1049
  #)
1050
 
1051
- # Filtered Moving Average (FMA) with tooltip
1052
- use_fma = st.sidebar.checkbox(
1053
- 'Filtered Moving Average (FMA)',
1054
- value=st.session_state.get('use_fma', False),
1055
- help="Select to apply Filtered Moving Average (FMA) to the stock price."
1056
- )
1057
- fma_period = st.sidebar.number_input(
1058
- 'FMA Period',
1059
- min_value=1,
1060
- value=st.session_state.get('fma_period', 14),
1061
- step=1,
1062
- disabled=not use_fma,
1063
- help="Specify the period (in days) for the FMA."
1064
- )
1065
 
1066
  # Grid toggle with tooltip
1067
  show_grid = st.sidebar.checkbox(
@@ -1389,7 +1423,6 @@ st.markdown(
1389
  )
1390
 
1391
 
1392
-
1393
  hide_streamlit_style = """
1394
  <style>
1395
  #MainMenu {visibility: hidden;}
 
503
  )
504
 
505
  # EMA with tooltip
506
+ with st.sidebar.expander("Exponential Moving Average (EMA)", expanded=False):
507
+ use_ema = st.checkbox(
508
+ 'Enable EMA',
509
+ value=st.session_state.get('use_ema', False),
510
+ help="Select to apply Exponential Moving Average (EMA) to the stock price."
511
+ )
512
+ ema_period = st.number_input(
513
+ 'EMA Period',
514
+ min_value=1,
515
+ value=st.session_state.get('ema_period', 50),
516
+ step=1,
517
+ disabled=not use_ema,
518
+ help="Specify the period (in days) for the EMA."
519
+ )
520
+
521
  # WMA with tooltip
522
+ with st.sidebar.expander("Weighted Moving Average (WMA)", expanded=False):
523
+ use_wma = st.checkbox(
524
+ 'Enable WMA',
525
+ value=st.session_state.get('use_wma', False),
526
+ help="Select to apply Weighted Moving Average (WMA) to the stock price."
527
+ )
528
+ wma_period = st.number_input(
529
+ 'WMA Period',
530
+ min_value=1,
531
+ value=st.session_state.get('wma_period', 50),
532
+ step=1,
533
+ disabled=not use_wma,
534
+ help="Specify the period (in days) for the WMA."
535
+ )
536
+
537
  # DEMA with tooltip
538
+ with st.sidebar.expander("Double Exponential Moving Average (DEMA)", expanded=False):
539
+ use_dema = st.checkbox(
540
+ 'Enable DEMA',
541
+ value=st.session_state.get('use_dema', False),
542
+ help="Select to apply Double Exponential Moving Average (DEMA) to the stock price."
543
+ )
544
+ dema_period = st.number_input(
545
+ 'DEMA Period',
546
+ min_value=1,
547
+ value=st.session_state.get('dema_period', 50),
548
+ step=1,
549
+ disabled=not use_dema,
550
+ help="Specify the period (in days) for the DEMA."
551
+ )
552
+
553
  # TEMA with tooltip
554
+ with st.sidebar.expander("Triple Exponential Moving Average (TEMA)", expanded=False):
555
+ use_tema = st.checkbox(
556
+ 'Enable TEMA',
557
+ value=st.session_state.get('use_tema', False),
558
+ help="Select to apply Triple Exponential Moving Average (TEMA) to the stock price."
559
+ )
560
+ tema_period = st.number_input(
561
+ 'TEMA Period',
562
+ min_value=1,
563
+ value=st.session_state.get('tema_period', 50),
564
+ step=1,
565
+ disabled=not use_tema,
566
+ help="Specify the period (in days) for the TEMA."
567
+ )
568
+
569
  # VAMA with tooltip
570
+ with st.sidebar.expander("Volume-Adjusted Moving Average (VAMA)", expanded=False):
571
+ use_vama = st.checkbox(
572
+ 'Enable VAMA',
573
+ value=st.session_state.get('use_vama', False),
574
+ help="Select to apply Volume-Adjusted Moving Average (VAMA) to the stock price."
575
+ )
576
+ vama_period = st.number_input(
577
+ 'VAMA Period',
578
+ min_value=1,
579
+ value=st.session_state.get('vama_period', 50),
580
+ step=1,
581
+ disabled=not use_vama,
582
+ help="Specify the period (in days) for the VAMA."
583
+ )
584
+
585
  # KAMA with tooltip
586
+ with st.sidebar.expander("Kaufman Adaptive Moving Average (KAMA)", expanded=False):
587
+ use_kama = st.checkbox(
588
+ 'Enable KAMA',
589
+ value=st.session_state.get('use_kama', False),
590
+ help="Select to apply Kaufman Adaptive Moving Average (KAMA) to the stock price."
591
+ )
592
+ kama_period = st.number_input(
593
+ 'KAMA Period',
594
+ min_value=1,
595
+ value=st.session_state.get('kama_period', 10),
596
+ step=1,
597
+ disabled=not use_kama,
598
+ help="Specify the efficiency ratio period (in days) for the KAMA."
599
+ )
600
+ fastest_period = st.number_input(
601
+ 'Fastest SC Period',
602
+ min_value=1,
603
+ value=st.session_state.get('fastest_period', 2),
604
+ step=1,
605
+ disabled=not use_kama,
606
+ help="Specify the fastest smoothing constant period."
607
+ )
608
+ slowest_period = st.number_input(
609
+ 'Slowest SC Period',
610
+ min_value=1,
611
+ value=st.session_state.get('slowest_period', 30),
612
+ step=1,
613
+ disabled=not use_kama,
614
+ help="Specify the slowest smoothing constant period."
615
+ )
616
+
617
  # TMA with tooltip
618
+ with st.sidebar.expander("Triangular Moving Average (TMA)", expanded=False):
619
+ use_tma = st.checkbox(
620
+ 'Enable TMA',
621
+ value=st.session_state.get('use_tma', False),
622
+ help="Select to apply Triangular Moving Average (TMA) to the stock price."
623
+ )
624
+ tma_period = st.number_input(
625
+ 'TMA Period',
626
+ min_value=1,
627
+ value=st.session_state.get('tma_period', 20),
628
+ step=1,
629
+ disabled=not use_tma,
630
+ help="Specify the period (in days) for the TMA."
631
+ )
632
 
633
  # Hull MA with tooltip
634
+ with st.sidebar.expander("Hull Moving Average (HMA)", expanded=False):
635
+ use_hull_ma = st.checkbox(
636
+ 'Enable HMA',
637
+ value=st.session_state.get('use_hull_ma', False),
638
+ help="Select to apply Hull Moving Average (HMA) to the stock price."
639
+ )
640
+ hull_ma_period = st.number_input(
641
+ 'HMA Period',
642
+ min_value=1,
643
+ value=st.session_state.get('hull_ma_period', 120),
644
+ step=1,
645
+ disabled=not use_hull_ma,
646
+ help="Specify the period (in days) for the Hull Moving Average."
647
+ )
648
+
649
  # Harmonic MA with tooltip
650
+ with st.sidebar.expander("Harmonic Moving Average (HMA)", expanded=False):
651
+ use_harmonic_ma = st.checkbox(
652
+ 'Enable HMA',
653
+ value=st.session_state.get('use_harmonic_ma', False),
654
+ help="Select to apply Harmonic Moving Average (HMA) to the stock price."
655
+ )
656
+ harmonic_ma_period = st.number_input(
657
+ 'HMA Period',
658
+ min_value=1,
659
+ value=st.session_state.get('harmonic_ma_period', 120),
660
+ step=1,
661
+ disabled=not use_harmonic_ma,
662
+ help="Specify the period (in days) for the Harmonic Moving Average."
663
+ )
664
+
665
  # FRAMA with tooltip
666
+ with st.sidebar.expander("Fractal Adaptive Moving Average (FRAMA)", expanded=False):
667
+ use_frama = st.checkbox(
668
+ 'Enable FRAMA',
669
+ value=st.session_state.get('use_frama', False),
670
+ help="Select to apply Fractal Adaptive Moving Average (FRAMA) to the stock price."
671
+ )
672
+ frama_batch = st.number_input(
673
+ 'FRAMA Batch Size',
674
+ min_value=1,
675
+ value=st.session_state.get('frama_batch', 10),
676
+ step=1,
677
+ disabled=not use_frama,
678
+ help="Specify the batch size for FRAMA calculation."
679
+ )
680
+
681
  # ZLEMA with tooltip
682
+ with st.sidebar.expander("Zero Lag Exponential Moving Average (ZLEMA)", expanded=False):
683
+ use_zlema = st.checkbox(
684
+ 'Enable ZLEMA',
685
+ value=st.session_state.get('use_zlema', False),
686
+ help="Select to apply Zero Lag Exponential Moving Average (ZLEMA) to the stock price."
687
+ )
688
+ zlema_period = st.number_input(
689
+ 'ZLEMA Period',
690
+ min_value=1,
691
+ value=st.session_state.get('zlema_period', 28),
692
+ step=1,
693
+ disabled=not use_zlema,
694
+ help="Specify the period (in days) for the ZLEMA."
695
+ )
696
+
697
  # VIDYA with tooltip
698
+ with st.sidebar.expander("Variable Index Dynamic Average (VIDYA)", expanded=False):
699
+ use_vidya = st.checkbox(
700
+ 'Enable VIDYA',
701
+ value=st.session_state.get('use_vidya', False),
702
+ help="Select to apply Variable Index Dynamic Average (VIDYA) to the stock price."
703
+ )
704
+ vidya_period = st.number_input(
705
+ 'VIDYA Period',
706
+ min_value=1,
707
+ value=st.session_state.get('vidya_period', 14),
708
+ step=1,
709
+ disabled=not use_vidya,
710
+ help="Specify the period (in days) for the VIDYA."
711
+ )
712
+
713
  # ALMA with tooltip
714
+ with st.sidebar.expander("Arnaud Legoux Moving Average (ALMA)", expanded=False):
715
+ use_alma = st.checkbox(
716
+ 'Enable ALMA',
717
+ value=st.session_state.get('use_alma', False),
718
+ help="Select to apply Arnaud Legoux Moving Average (ALMA) to the stock price."
719
+ )
720
+ alma_period = st.number_input(
721
+ 'ALMA Period',
722
+ min_value=1,
723
+ value=st.session_state.get('alma_period', 36),
724
+ step=1,
725
+ disabled=not use_alma,
726
+ help="Specify the period (in days) for the ALMA."
727
+ )
728
+ alma_offset = st.number_input(
729
+ 'ALMA Offset',
730
+ min_value=0.0,
731
+ max_value=1.0,
732
+ value=st.session_state.get('alma_offset', 0.85),
733
+ step=0.01,
734
+ disabled=not use_alma,
735
+ help="Specify the offset for the ALMA (0 to 1)."
736
+ )
737
+ alma_sigma = st.number_input(
738
+ 'ALMA Sigma',
739
+ min_value=1,
740
+ value=st.session_state.get('alma_sigma', 6),
741
+ step=1,
742
+ disabled=not use_alma,
743
+ help="Specify the sigma for the ALMA."
744
+ )
745
+
746
  # MAMA and FAMA with tooltip
747
+ with st.sidebar.expander("MESA Adaptive Moving Average (MAMA) & FAMA", expanded=False):
748
+ use_mama_fama = st.checkbox(
749
+ 'Enable MAMA & FAMA',
750
+ value=st.session_state.get('use_mama_fama', False),
751
+ help="Select to apply MESA Adaptive Moving Average (MAMA) and Following Adaptive Moving Average (FAMA) to the stock price."
752
+ )
753
+ mama_fast_limit = st.number_input(
754
+ 'MAMA Fast Limit',
755
+ min_value=0.0,
756
+ max_value=1.0,
757
+ value=st.session_state.get('mama_fast_limit', 0.5),
758
+ step=0.01,
759
+ disabled=not use_mama_fama,
760
+ help="Specify the fast limit for MAMA (0 to 1)."
761
+ )
762
+ mama_slow_limit = st.number_input(
763
+ 'MAMA Slow Limit',
764
+ min_value=0.0,
765
+ max_value=1.0,
766
+ value=st.session_state.get('mama_slow_limit', 0.05),
767
+ step=0.01,
768
+ disabled=not use_mama_fama,
769
+ help="Specify the slow limit for MAMA (0 to 1)."
770
+ )
771
 
772
  # APMA with tooltip
773
+ with st.sidebar.expander("Adaptive Period Moving Average (APMA)", expanded=False):
774
+ use_apma = st.checkbox(
775
+ 'Enable APMA',
776
+ value=st.session_state.get('use_apma', False),
777
+ help="Select to apply Adaptive Period Moving Average (APMA) to the stock price."
778
+ )
779
+ apma_min_period = st.number_input(
780
+ 'APMA Min Period',
781
+ min_value=1,
782
+ value=st.session_state.get('apma_min_period', 5),
783
+ step=1,
784
+ disabled=not use_apma,
785
+ help="Specify the minimum period for the APMA."
786
+ )
787
+ apma_max_period = st.number_input(
788
+ 'APMA Max Period',
789
+ min_value=1,
790
+ value=st.session_state.get('apma_max_period', 30),
791
+ step=1,
792
+ disabled=not use_apma,
793
+ help="Specify the maximum period for the APMA."
794
+ )
795
+
796
  # Rainbow EMA with tooltip
797
+ with st.sidebar.expander("Rainbow Moving Average (EMA)", expanded=False):
798
+ use_rainbow_ema = st.checkbox(
799
+ 'Enable Rainbow EMA',
800
+ value=st.session_state.get('use_rainbow_ema', False),
801
+ help="Select to apply Rainbow Moving Average (EMA) with multiple lookback periods to the stock price."
802
+ )
803
+ rainbow_lookback_periods = st.multiselect(
804
+ 'Rainbow Lookback Periods',
805
+ options=[2, 4, 8, 16, 32, 64, 128, 192, 320, 512],
806
+ default=st.session_state.get('rainbow_lookback_periods', [2, 4, 8, 16, 32, 64, 128]),
807
+ disabled=not use_rainbow_ema,
808
+ help="Select multiple lookback periods for the Rainbow EMA."
809
+ )
810
+
811
  # Wilders MA with tooltip
812
+ with st.sidebar.expander("Wilders Moving Average (Wilder's MA)", expanded=False):
813
+ use_wilders_ma = st.checkbox(
814
+ 'Enable Wilders MA',
815
+ value=st.session_state.get('use_wilders_ma', False),
816
+ help="Select to apply Wilder's Moving Average to the stock price."
817
+ )
818
+ wilders_ma_period = st.number_input(
819
+ 'Wilders MA Period',
820
+ min_value=1,
821
+ value=st.session_state.get('wilders_ma_period', 14),
822
+ step=1,
823
+ disabled=not use_wilders_ma,
824
+ help="Specify the period (in days) for Wilder's Moving Average."
825
+ )
826
+
827
  # SMMA with tooltip
828
+ with st.sidebar.expander("Smoothed Moving Average (SMMA)", expanded=False):
829
+ use_smma = st.checkbox(
830
+ 'Enable SMMA',
831
+ value=st.session_state.get('use_smma', False),
832
+ help="Select to apply Smoothed Moving Average (SMMA) to the stock price."
833
+ )
834
+ smma_period = st.number_input(
835
+ 'SMMA Period',
836
+ min_value=1,
837
+ value=st.session_state.get('smma_period', 28),
838
+ step=1,
839
+ disabled=not use_smma,
840
+ help="Specify the period (in days) for the SMMA."
841
+ )
842
+
843
  # GMMA with tooltip
844
+ with st.sidebar.expander("Guppy Multiple Moving Average (GMMA)", expanded=False):
845
+ use_gmma = st.checkbox(
846
+ 'Enable GMMA',
847
+ value=st.session_state.get('use_gmma', False),
848
+ help="Select to apply Guppy Multiple Moving Average (GMMA) to the stock price."
849
+ )
850
+ gmma_short_periods = st.multiselect(
851
+ 'GMMA Short Periods',
852
+ options=[3, 5, 8, 10, 12, 15],
853
+ default=st.session_state.get('gmma_short_periods', [3, 5, 8, 10, 12, 15]),
854
+ disabled=not use_gmma,
855
+ help="Select the short-term periods for GMMA."
856
+ )
857
+ gmma_long_periods = st.multiselect(
858
+ 'GMMA Long Periods',
859
+ options=[30, 35, 40, 45, 50, 60],
860
+ default=st.session_state.get('gmma_long_periods', [30, 35, 40, 45, 50, 60]),
861
+ disabled=not use_gmma,
862
+ help="Select the long-term periods for GMMA."
863
+ )
864
+
865
  # LSMA with tooltip
866
+ with st.sidebar.expander("Least Squares Moving Average (LSMA)", expanded=False):
867
+ use_lsma = st.checkbox(
868
+ 'Enable LSMA',
869
+ value=st.session_state.get('use_lsma', False),
870
+ help="Select to apply Least Squares Moving Average (LSMA) to the stock price."
871
+ )
872
+ lsma_period = st.number_input(
873
+ 'LSMA Period',
874
+ min_value=1,
875
+ value=st.session_state.get('lsma_period', 28),
876
+ step=1,
877
+ disabled=not use_lsma,
878
+ help="Specify the period (in days) for the LSMA."
879
+ )
880
+
881
  # MMA (Welch's MMA) with tooltip
882
+ with st.sidebar.expander("Welch's Moving Average (MMA)", expanded=False):
883
+ use_mma = st.checkbox(
884
+ 'Enable MMA',
885
+ value=st.session_state.get('use_mma', False),
886
+ help="Select to apply Welch's Moving Average (Modified Moving Average) to the stock price."
887
+ )
888
+ mma_period = st.number_input(
889
+ 'MMA Period',
890
+ min_value=1,
891
+ value=st.session_state.get('mma_period', 14),
892
+ step=1,
893
+ disabled=not use_mma,
894
+ help="Specify the period (in days) for the MMA."
895
+ )
896
+
897
  # SinWMA with tooltip
898
+ with st.sidebar.expander("Sin-weighted Moving Average (SinWMA)", expanded=False):
899
+ use_sinwma = st.checkbox(
900
+ 'Enable SinWMA',
901
+ value=st.session_state.get('use_sinwma', False),
902
+ help="Select to apply Sin-weighted Moving Average (SinWMA) to the stock price."
903
+ )
904
+ sinwma_period = st.number_input(
905
+ 'SinWMA Period',
906
+ min_value=1,
907
+ value=st.session_state.get('sinwma_period', 21),
908
+ step=1,
909
+ disabled=not use_sinwma,
910
+ help="Specify the period (in days) for the SinWMA."
911
+ )
912
+
913
  # MedMA with tooltip
914
+ with st.sidebar.expander("Median Moving Average (MedMA)", expanded=False):
915
+ use_medma = st.checkbox(
916
+ 'Enable MedMA',
917
+ value=st.session_state.get('use_medma', False),
918
+ help="Select to apply Median Moving Average (MedMA) to the stock price."
919
+ )
920
+ medma_period = st.number_input(
921
+ 'MedMA Period',
922
+ min_value=1,
923
+ value=st.session_state.get('medma_period', 20),
924
+ step=1,
925
+ disabled=not use_medma,
926
+ help="Specify the period (in days) for the MedMA."
927
+ )
928
+
929
  # GMA with tooltip
930
+ with st.sidebar.expander("Geometric Moving Average (GMA)", expanded=False):
931
+ use_gma = st.checkbox(
932
+ 'Enable GMA',
933
+ value=st.session_state.get('use_gma', False),
934
+ help="Select to apply Geometric Moving Average (GMA) to the stock price."
935
+ )
936
+ gma_period = st.number_input(
937
+ 'GMA Period',
938
+ min_value=1,
939
+ value=st.session_state.get('gma_period', 20),
940
+ step=1,
941
+ disabled=not use_gma,
942
+ help="Specify the period (in days) for the GMA."
943
+ )
944
+
945
  # eVWMA with tooltip
946
+ with st.sidebar.expander("Elastic Volume Weighted Moving Average (eVWMA)", expanded=False):
947
+ use_evwma = st.checkbox(
948
+ 'Enable eVWMA',
949
+ value=st.session_state.get('use_evwma', False),
950
+ help="Select to apply Elastic Volume Weighted Moving Average (eVWMA) to the stock price."
951
+ )
952
+ evwma_period = st.number_input(
953
+ 'eVWMA Period',
954
+ min_value=1,
955
+ value=st.session_state.get('evwma_period', 20),
956
+ step=1,
957
+ disabled=not use_evwma,
958
+ help="Specify the period (in days) for the eVWMA."
959
+ )
960
 
961
  # REMA with tooltip
962
+ with st.sidebar.expander("Regularized Exponential Moving Average (REMA)", expanded=False):
963
+ use_rema = st.checkbox(
964
+ 'Enable REMA',
965
+ value=st.session_state.get('use_rema', False),
966
+ help="Select to apply Regularized Exponential Moving Average (REMA) to the stock price."
967
+ )
968
+ rema_alpha = st.number_input(
969
+ 'REMA Alpha',
970
+ min_value=0.0,
971
+ max_value=1.0,
972
+ value=st.session_state.get('rema_alpha', 0.1),
973
+ step=0.01,
974
+ disabled=not use_rema,
975
+ help="Specify the alpha value for the REMA (0 to 1)."
976
+ )
977
+ rema_lambda = st.number_input(
978
+ 'REMA Lambda',
979
+ min_value=0.0,
980
+ max_value=1.0,
981
+ value=st.session_state.get('rema_lambda', 0.1),
982
+ step=0.01,
983
+ disabled=not use_rema,
984
+ help="Specify the lambda value for the REMA (0 to 1)."
985
+ )
986
+
987
  # PWMA with tooltip
988
+ with st.sidebar.expander("Parabolic Weighted Moving Average (PWMA)", expanded=False):
989
+ use_pwma = st.checkbox(
990
+ 'Enable PWMA',
991
+ value=st.session_state.get('use_pwma', False),
992
+ help="Select to apply Parabolic Weighted Moving Average (PWMA) to the stock price."
993
+ )
994
+ pwma_period = st.number_input(
995
+ 'PWMA Period',
996
+ min_value=1,
997
+ value=st.session_state.get('pwma_period', 14),
998
+ step=1,
999
+ disabled=not use_pwma,
1000
+ help="Specify the period (in days) for the PWMA."
1001
+ )
1002
+
1003
  # JMA with tooltip
1004
+ with st.sidebar.expander("Jurik Moving Average (JMA)", expanded=False):
1005
+ use_jma = st.checkbox(
1006
+ 'Enable JMA',
1007
+ value=st.session_state.get('use_jma', False),
1008
+ help="Select to apply Jurik Moving Average (JMA) to the stock price."
1009
+ )
1010
+ jma_period = st.number_input(
1011
+ 'JMA Period',
1012
+ min_value=1,
1013
+ value=st.session_state.get('jma_period', 28),
1014
+ step=1,
1015
+ disabled=not use_jma,
1016
+ help="Specify the period (in days) for the JMA."
1017
+ )
1018
+ jma_phase = st.number_input(
1019
+ 'JMA Phase',
1020
+ min_value=-100.0,
1021
+ max_value=100.0,
1022
+ value=st.session_state.get('jma_phase', 0.0),
1023
+ step=0.1,
1024
+ disabled=not use_jma,
1025
+ help="Specify the phase for the JMA (-100 to 100)."
1026
+ )
1027
+
1028
  # EPMA with tooltip
1029
+ with st.sidebar.expander("End Point Moving Average (EPMA)", expanded=False):
1030
+ use_epma = st.checkbox(
1031
+ 'Enable EPMA',
1032
+ value=st.session_state.get('use_epma', False),
1033
+ help="Select to apply End Point Moving Average (EPMA) to the stock price."
1034
+ )
1035
+ epma_period = st.number_input(
1036
+ 'EPMA Period',
1037
+ min_value=1,
1038
+ value=st.session_state.get('epma_period', 28),
1039
+ step=1,
1040
+ disabled=not use_epma,
1041
+ help="Specify the period (in days) for the EPMA."
1042
+ )
1043
+
1044
  # CMA with tooltip
1045
+ with st.sidebar.expander("Chande Moving Average (CMA)", expanded=False):
1046
+ use_cma = st.checkbox(
1047
+ 'Enable CMA',
1048
+ value=st.session_state.get('use_cma', False),
1049
+ help="Select to apply Chande Moving Average (CMA) to the stock price."
1050
+ )
1051
+ cma_period = len(data['Close']) # This does not require user input.
1052
+
1053
  # McGinley Dynamic with tooltip
1054
+ with st.sidebar.expander("McGinley Dynamic", expanded=False):
1055
+ use_mcginley_dynamic = st.checkbox(
1056
+ 'Enable McGinley Dynamic',
1057
+ value=st.session_state.get('use_mcginley_dynamic', False),
1058
+ help="Select to apply McGinley Dynamic to the stock price."
1059
+ )
1060
+ mcginley_dynamic_period = st.number_input(
1061
+ 'McGinley Dynamic Period',
1062
+ min_value=1,
1063
+ value=st.session_state.get('mcginley_dynamic_period', 14),
1064
+ step=1,
1065
+ disabled=not use_mcginley_dynamic,
1066
+ help="Specify the period (in days) for the McGinley Dynamic."
1067
+ )
1068
+
1069
+ # Filtered Moving Average (FMA) with tooltip
1070
+ with st.sidebar.expander("Filtered Moving Average (FMA)", expanded=False):
1071
+ use_fma = st.checkbox(
1072
+ 'Enable FMA',
1073
+ value=st.session_state.get('use_fma', False),
1074
+ help="Select to apply Filtered Moving Average (FMA) to the stock price."
1075
+ )
1076
+ fma_period = st.number_input(
1077
+ 'FMA Period',
1078
+ min_value=1,
1079
+ value=st.session_state.get('fma_period', 14),
1080
+ step=1,
1081
+ disabled=not use_fma,
1082
+ help="Specify the period (in days) for the FMA."
1083
+ )
1084
+
1085
 
1086
  # Anchored Moving Average (AMA) with tooltip
1087
  #use_ama = st.sidebar.checkbox(
 
1096
  # help="Select the anchor date for the AMA."
1097
  #)
1098
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1099
 
1100
  # Grid toggle with tooltip
1101
  show_grid = st.sidebar.checkbox(
 
1423
  )
1424
 
1425
 
 
1426
  hide_streamlit_style = """
1427
  <style>
1428
  #MainMenu {visibility: hidden;}