Holy Graily Bob 'n Thomas multi-pair and dashboard EA

EA's inspired by nanningbob's work here, especially those based on his 240 Moving Average trend detection filter.
Post Reply
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Holy Graily Bob 'n Thomas multi-pair and dashboard EA

Post by SteveHopwood »

V 1i is in post 1, with the fix for the missing function call thingy.

To DIY: do a search for "void ShutDownForTheWeekend(" (clear the 'Match whole word only' box).
Delete the function and replace it with this:

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 (!ForceTradeClosure)//Closure has succeeded
         TotalOpenTrades = 0;   
   }//if (CloseDelete)
      

}//End void ShutDownForTheWeekend()
Do a search for "//Have we finished trading for the week" and copy this over the top of the existing code:

Code: Select all

   //Have we finished trading for the week
   if (TotalOpenTrades > 0)
   {
      DoneForTheWeek = false;
      ShutDownForTheWeekend();
   }//if (TotalOpenTrades > 0)
   
:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Post Reply

Return to “Thingy Bob EA's”