Skip to content

Instantly share code, notes, and snippets.

View afifhusnul's full-sized avatar

Husnul Afif afifhusnul

View GitHub Profile
#!/bin/sh
## Settle your login 172.xxx.xxx.xxx (SSH/SFTP KEYLESS)
## Follow the step from this url : https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps
## create a new folder RAW, INPUT_RAW, OUTPUT_RAW --> (mkdir - p RAW)
## Put your file into /home/$USER/INPUT_RAW
## This script will cut file from 1rst column into 1 piece to Decrypt
## To send into /opt/link/mediation/decrypt/input
## How to execute --> thisScrIpt.sh <user> <email@address.com>
#!/bin/sh
## Put your file into /home/$USER/INPUT_RAW
## Cut file into 1 piece to Decrypt
## To send into /opt/link/mediation/decrypt/input
## to execute --> ./cmpExtDecrypt.sh
log_dttm=`date +"%Y%m%d_%H%M%S"`
##--------------- Define the stuff (Change the email ID if necessary)
#!/bin/sh
## Put your file into /home/$USER/INPUT_RAW
## Cut file into 1 piece to Decrypt
## Original file /opt/link/cams/data_export/de_simple_sp_20485_20200724T165102.csv
## To send into /opt/link/mediation/decrypt/input
## execute it as --> ./cmpJobDecrypt.sh <filename.csv> emailId in Digi server ( WITHOUT DOMAIN .digi.com.my)
## Sample execution --> ./cmpJobDecrypt.sh <de_simple_sp_20485_20200724T165102.csv> nusnafif
#!/bin/bash
echo digi123 | sudo -S lsof -i -P -n | grep LISTEN
read -p "Enter port : " port
/bin/kill -9 $(lsof -t -i:$port)
//=========================
_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 );
_SECTION_BEGIN("MACD1");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorBrightGreen ), ParamStyle("MACD style") );
Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorRed ), ParamStyle("Signal style") );
Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color", colorBlack ), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) );
Buy= Cross(ml , sl);
Sell= Cross( sl, ml);
/*
Pit Strategy
Author: Mahfudh
Email: Info@alifia.co.id
*/
//Inputs
Lookback=60;
Baseline=50;/* jangan diganti*/
PerCent=95;
Pds =14;
SetChartOptions(0,chartShowArrows | chartShowDates);
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() ;
// Afl ini berasal dari diskusi di room Tele @AmiBrokerAA yang script awal dari:
// Aulia Rahmat, Arief Budiman, Markezot dan @abdulaziso
_SECTION_BEGIN("Double Pixel From @AmiBrokerAA");
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
#-------------------- Additional for GIT
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
#---------------- Setting Proxy
# Set Proxy
function setproxy() {
export {http,https,ftp}_proxy="http://crproxy.digicr.digi.com.my:8001"