Dear Friends,,
I want to implement an afl code to find Daily Loss Limit in intraday trading. I will use the code for backtesting around 200 days.
I have the following code, but it has serious mistakes.
Any help will be appreciated.
Thanks.
I want to implement an afl code to find Daily Loss Limit in intraday trading. I will use the code for backtesting around 200 days.
I have the following code, but it has serious mistakes.
Code:
// identify new day
dn = DateNum();
newDay = dn != Ref( dn,-1);
// Daily Loss Limit
dll = Optimize("dll", 0, 5, 10000, 5 );
EquityCount = 10000;
for( i = 0; i < BarCount; i++ )
{
// signals
Buy = ....;
Sell = ....;
diff = (Equity(1) - Ref(Equity(1), -1));
EquityCount = EquityCount + diff;
// allow only dll
Buy = Buy AND EquityCount > dll;
}
Thanks.
Daily Loss Limit
Aucun commentaire:
Enregistrer un commentaire