@@ -577,7 +577,6 @@ def toogleRsi(self):
577
577
paramDialog .setWindowFlags (QtCore .Qt .CustomizeWindowHint )
578
578
paramDialog .setTitle ("RSI Indicator parameters" )
579
579
paramDialog .addParameter ("RSI Period" , 14 )
580
- #paramDialog.setStyleSheet("QDialog{ border: 1px solid green; }")
581
580
paramDialog .adjustSize ()
582
581
583
582
if (paramDialog .exec () == QtWidgets .QDialog .Accepted ):
@@ -596,11 +595,61 @@ def toogleRsi(self):
596
595
pass
597
596
598
597
def toogleStochastic (self ):
599
- self .dock_stochastic .show () if self .StochasticPB .isChecked () else self .dock_stochastic .hide ()
598
+
599
+ if self .StochasticPB .isChecked ():
600
+ # Show indicator parameter dialog
601
+ paramDialog = indicatorParametersUI .IndicatorParametersUI (self .dock_chart )
602
+ paramDialog .setWindowFlags (QtCore .Qt .CustomizeWindowHint )
603
+ paramDialog .setTitle ("Stochastic Indicator parameters" )
604
+ paramDialog .addParameter ("Stochastic Period K" , 14 )
605
+ paramDialog .addParameter ("Stochastic Smooth K" , 3 )
606
+ paramDialog .addParameter ("Stochastic Smooth D" , 3 )
607
+ paramDialog .adjustSize ()
608
+
609
+ if (paramDialog .exec () == QtWidgets .QDialog .Accepted ):
610
+ period = paramDialog .getValue ("Stochastic Period K" )
611
+ smooth_k = paramDialog .getValue ("Stochastic Smooth K" )
612
+ smooth_d = paramDialog .getValue ("Stochastic Smooth D" )
613
+
614
+ self .fpltWindow .drawStochastic ( period , smooth_k , smooth_d )
615
+ self .dock_stochastic .show ()
616
+ else :
617
+ # Cancel
618
+ self .RsiPB .setChecked (False )
619
+ self .dock_stochastic .hide ()
620
+
621
+ else :
622
+ self .dock_stochastic .hide ()
623
+
600
624
pass
601
625
602
626
def toogleStochasticRsi (self ):
603
- self .dock_stochasticRsi .show () if self .StochasticRsiPB .isChecked () else self .dock_stochasticRsi .hide ()
627
+
628
+ if self .StochasticRsiPB .isChecked ():
629
+ # Show indicator parameter dialog
630
+ paramDialog = indicatorParametersUI .IndicatorParametersUI (self .dock_chart )
631
+ paramDialog .setWindowFlags (QtCore .Qt .CustomizeWindowHint )
632
+ paramDialog .setTitle ("Stochastic Indicator parameters" )
633
+ paramDialog .addParameter ("Stochastic Rsi Period K" , 14 )
634
+ paramDialog .addParameter ("Stochastic Rsi Smooth K" , 3 )
635
+ paramDialog .addParameter ("Stochastic Rsi Smooth D" , 3 )
636
+ paramDialog .adjustSize ()
637
+
638
+ if (paramDialog .exec () == QtWidgets .QDialog .Accepted ):
639
+ period = paramDialog .getValue ("Stochastic Rsi Period K" )
640
+ smooth_k = paramDialog .getValue ("Stochastic Rsi Smooth K" )
641
+ smooth_d = paramDialog .getValue ("Stochastic Rsi Smooth D" )
642
+
643
+ self .fpltWindow .drawStochasticRsi ( period , smooth_k , smooth_d )
644
+ self .dock_stochasticRsi .show ()
645
+ else :
646
+ # Cancel
647
+ self .RsiPB .setChecked (False )
648
+ self .dock_stochasticRsi .hide ()
649
+
650
+ else :
651
+ self .dock_stochasticRsi .hide ()
652
+
604
653
pass
605
654
606
655
# On chart indicators
0 commit comments