I added the SampleHaltStrategy example to my strategy to get an idea of how it would work. I only get 3 trades on my opening chart and then the strategy takes no more trades. It seems that the StopStrategy() can stop the strategy ok, but doesn't restart it the next day. Can someone give me an example of how to start everything up the next day. Here is my code. Maybe I've done something wrong.
if (Performance.AllTrades.TradesPerformance.Currency. CumProfit > 1000
|| Performance.AllTrades.TradesPerformance.Currency.C umProfit < -400)
{
StopStrategy();
return;
}
Print("OnBarUpdate(): " + Time[0]);
{
my strategy conditions
}
private void StopStrategy()
{
// If we have a position we will need to close the position
if (Position.MarketPosition == MarketPosition.Long)
{
ExitLong("End Trading", "VCR Long");
ExitLong("End Trading", "Runner Long");
}
else if (Position.MarketPosition == MarketPosition.Short)
{
ExitShort("End Trading", "VCR Short");
ExitShort("End Trading", "Runner Short");
}
Comment