Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created June 17, 2016 09:42
Show Gist options
  • Save marketcalls/69e467292cca91671eeab3e65cbe6cbe to your computer and use it in GitHub Desktop.
Save marketcalls/69e467292cca91671eeab3e65cbe6cbe to your computer and use it in GitHub Desktop.
SIP - Dollar Cost Averaging
FixedDollarAmount = 5000; //SIP monthly Rs5000
MonthBegin = Month() != Ref( Month(), -1 );
FirstPurchase = Cum( MonthBegin ) == 1;
Buy = IIf( FirstPurchase, 1, // True (or 1) represents regular buy signal
IIf( MonthBegin, sigScaleIn, // each month increase position
0 ) ); // otherwise no signal
Sell = 0; // we do not sell
PositionSize = FixedDollarAmount;
//SetPositionSize(FixedDollarAmount,spsValue);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment