Created
October 15, 2019 23:03
-
-
Save afifhusnul/fdfc4bcde8cd27506c628f5dd1037c56 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//========================= | |
_Section_Begin("My Explorer"); | |
HaClose = (O + H + L + C)/4; | |
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 ); | |
HaHigh = Max( H, Max( HaClose, HaOpen ) ); | |
HaLow = Min( L, Min( HaClose, HaOpen ) ); | |
xDiff = (HaHigh - Halow) * 10000; | |
barcolor = IIf(HaClose >= HaOpen,colorGreen,colorRed); | |
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "", barcolor, styleCandle ); | |
stochup= StochK()>StochD() ; | |
MACDup= MACD()>Signal() ; | |
Hist= MACD()-Signal() ; | |
Histup= Hist>Ref(Hist,-1) ; | |
HAup= HaClose>=HaOpen ; | |
BuyHa= HaClose>=HaOpen ; | |
SellHa= HaClose<HaOpen ; | |
tgl = ParamToggle("Result", "AND logic|Compare"); | |
// switch test calculation and compare the results | |
if(tgl) | |
{ | |
myBuy = BuyHa AND macdup AND histup AND stochup ; | |
myShort = SellHa AND !histup AND !stochup ; | |
} | |
else | |
{ | |
myBuy = IIf( HaClose>=HaOpen AND MACD()>Signal() AND Hist>Ref(Hist,-1) AND StochK()>StochD() ,1,0) ; | |
myShort = IIf( HaClose<HaOpen AND Hist<Ref(Hist,-1) AND StochK()<StochD() ,1,0); | |
} | |
Buy = ExRem(mybuy,myshort); | |
Sell = ExRem(myshort,mybuy); | |
AKas = V*C; | |
Filter = Buy or Sell; | |
AddColumn(C, "Close", 1); | |
AddColumn(Buy, "Buy", 1, Colordefault, Iif(Buy, colorGreen, 0)); | |
AddColumn(Sell, "Sell", 1, Colordefault, Iif(Sell, colorRed, 0)); | |
AddColumn(AKas, " Total trx", 1); | |
_Section_End(); | |
//========================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment