I am trying to implement the following strategy in a backtest. Please tell me if it can be done with eSignal and/or point me to an example.
Thanks
The major points and questions are:
1] A new long position is entered every day if an entry limit price is touched
2] Each position can remain open for as long as 5 days if not closed on the first
day, so possibly 6 positions can be open simultaneously.
3] How do I test for contract age?
4] Must any backtest control parameters be re-set for the test?
-------------start of strategy pseudo-code
if(touched contract entry limit price X)
{
Strategy.doLong(...buy at limit price X...);
if(made a profit at the close that day)
{
Strategy.doSell(..sell that same day at the close..);
}
else
{
if(contract age <= 5 days)
{
if(high >= entry price X)
{
Strategy.doSell(...exit at entry price X...);
}
}
else
{
Strategy.doSell(...sell 6th day at close if did not recover to buy price...);
}
}
}
Thanks
The major points and questions are:
1] A new long position is entered every day if an entry limit price is touched
2] Each position can remain open for as long as 5 days if not closed on the first
day, so possibly 6 positions can be open simultaneously.
3] How do I test for contract age?
4] Must any backtest control parameters be re-set for the test?
-------------start of strategy pseudo-code
if(touched contract entry limit price X)
{
Strategy.doLong(...buy at limit price X...);
if(made a profit at the close that day)
{
Strategy.doSell(..sell that same day at the close..);
}
else
{
if(contract age <= 5 days)
{
if(high >= entry price X)
{
Strategy.doSell(...exit at entry price X...);
}
}
else
{
Strategy.doSell(...sell 6th day at close if did not recover to buy price...);
}
}
}
Comment