Peaky +415 +4696
Griddy +183 +820
Holy -86 +1154
Buddha -755 +577
Anyone else experience the failures?tomele wrote:Hi Steve.
Three of my 4 tests still didnt close their trades on Friday. Holy did, while Griddy, Peaky and Crossy refused.
Code: Select all
void ShutDownForTheWeekend()
{
//Close/delete all trades to be flat for the weekend.
int day = TimeDayOfWeek(TimeLocal() );
int hour = TimeHour(TimeLocal() );
bool CloseDelete = false;
//Friday
if (day == 5)
{
if (hour >= FridayCloseAllHour)
if (TotalCashUpl < 0)
{
if (TotalCashUpl >= MaxAllowableCashLoss)//MaxAllowableCashLoss is a negative number
CloseDelete = true;
} //if (TotalCashUpl < 0)
}//if (day == 5)
//Saturday
if (day == 6)
{
if (hour >= SaturdayCloseAllHour)
if (TotalCashUpl < 0)
{
if (TotalCashUpl >= MaxAllowableCashLoss)//MaxAllowableCashLoss is a negative number
CloseDelete = true;
} //if (TotalCashUpl < 0)
}//if (day == 6)
if (CloseDelete)
{
CloseAllTrades(AllSymbols, AllTrades);
if (ForceTradeClosure)
CloseAllTrades(AllSymbols, AllTrades);
if (ForceTradeClosure)
CloseAllTrades(AllSymbols, AllTrades);
}//if (CloseDelete)
}//End void ShutDownForTheWeekend()
Code: Select all
if (TotalCashUpl < 0)
{
...
}
Code: Select all
void ShutDownForTheWeekend()
{
//Close/delete all trades to be flat for the weekend.
int day = TimeDayOfWeek(TimeLocal() );
int hour = TimeHour(TimeLocal() );
bool CloseDelete = false;
//Friday
if (day == 5)
{
if (hour >= FridayCloseAllHour)
if (TotalCashUpl >= MaxAllowableCashLoss)//MaxAllowableCashLoss is a negative number
CloseDelete = true;
}//if (day == 5)
//Saturday
if (day == 6)
{
if (hour >= SaturdayCloseAllHour)
if (TotalCashUpl >= MaxAllowableCashLoss)//MaxAllowableCashLoss is a negative number
CloseDelete = true;
}//if (day == 6)
if (CloseDelete)
{
CloseAllTrades(AllSymbols, AllTrades);
if (ForceTradeClosure)
CloseAllTrades(AllSymbols, AllTrades);
if (ForceTradeClosure)
CloseAllTrades(AllSymbols, AllTrades);
}//if (CloseDelete)
}//End void ShutDownForTheWeekend()
Or carry a folder.....SteveHopwood » Wed Apr 25, 2018 8:00 pm wrote: Ever heard the phrase, "Don't shoot the messenger?"
The next messenger about this bloody function had better be wearing Gracie as body armour.