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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +594 -592
app.py CHANGED
@@ -483,604 +483,606 @@ if 'data' in st.session_state:
483
  data = st.session_state['data']
484
 
485
  # Moving average method selection
486
- st.sidebar.header("Moving Average Methods")
487
-
488
- # SMA with tooltip
489
- with st.sidebar.expander("Simple Moving Average", expanded=False):
490
- use_sma = st.checkbox(
491
- 'Simple Moving Average (SMA)',
492
- value=st.session_state.get('use_sma', False),
493
- help="Select to apply Simple Moving Average (SMA) to the stock price."
494
- )
495
-
496
- sma_period = st.number_input(
497
- 'SMA Period',
498
- min_value=1,
499
- value=st.session_state.get('sma_period', 50),
500
- step=1,
501
- disabled=not use_sma,
502
- help="Specify the period (in days) for the SMA."
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
 
483
  data = st.session_state['data']
484
 
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