QuantumLearner commited on
Commit
6f95e63
·
verified ·
1 Parent(s): 9f9fcb2

Update app.py

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