stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Moving Day
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5801
Page 9 of 18
Author:  woodlands [ Sat May 09, 2020 5:42 am ]
Post subject:  Moving Day

And the v small live one, trying too hard and not letting MD run itself..... :oops:
2020-05-09_100MD_2grid.png
Author:  SteveHopwood [ Sat May 09, 2020 9:27 am ]
Post subject:  Moving Day

woodlands » Sat May 09, 2020 5:42 am wrote:And the v small live one, trying too hard and not letting MD run itself..... :oops:
We both know how different it is trading live verses trading demo, however small the live cash account is. :lol: Interfere at will. Why not?

What is so exciting about your, mine and all the other results posted/available here is the percentage gain in such a short time. I posted my live results earlier in the week. I shall update the demo I feature at the end of post 2 later; it has more than doubled and this week has been fantastic.

Happy times.

:xm: :rocket:
Author:  SteveHopwood [ Sat May 09, 2020 1:54 pm ]
Post subject:  Moving Day

V 1k is in post 1. I found the reason MD was not deleting stop orders following a recross as soon as I looked for it. The relevant function was only coded to close the order types sent to it as a parameter, so it would close market trades but ignore stop orders. This should be fixed now.

DIYers, the easiest way is to go to these two functions:
void closeAllTrades(string symbol, int type)
void closeAllTradesFIFO(string symbol, int type) - directly underneath.

and replace the existing functions with these:

Code: Select all

void closeAllTrades(string symbol, int type)
{
   forceTradeClosure= false;
  
   
   if (OrdersTotal() == 0) return;
   
   //For US traders
   if (MustObeyFIFO)
   {
      closeAllTradesFIFO(symbol, type);
      return;
   }//if (MustObeyFIFO)
      

   bool result = false;
   for (int pass = 0; pass <= 1; pass++)
   {
      
      for (int cc = ArraySize(fifoTicket) - 1; cc >= 0; cc--)
      {
         if (!betterOrderSelect(fifoTicket[cc], SELECT_BY_TICKET, MODE_TRADES) ) continue;
         if (OrderMagicNumber() != MagicNumber) continue;
         if (OrderSymbol() != symbol) 
            if (symbol != AllSymbols)
               continue;
         if (type != AllTrades)
         {
            if (type == OP_BUY)
               if (OrderType() == OP_SELL || OrderType() == OP_SELLLIMIT || OrderType() == OP_SELLSTOP)
                  continue;
            
            if (type == OP_SELL)
               if (OrderType() == OP_BUY || OrderType() == OP_BUYLIMIT || OrderType() == OP_BUYSTOP)
                  continue;
         
         }//if (type != AllTrades)
         
         
         //if (OrderType() != type) 
         //   if (type != AllTrades)
         //      continue;
         
         while(IsTradeContextBusy()) Sleep(100);
         if (OrderType() < 2)
         {
            result = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 1000, CLR_NONE);
            if (result) 
            {
               cc++;
               openTrades--;
            }//(result) 
            
            if (!result) forceTradeClosure= true;
         }//if (OrderType() < 2)
         
         if (pass == 1)
            if (deletePendings)
               if (OrderType() > 1) 
               {
                  result = OrderDelete(OrderTicket(), clrNONE);
                  if (result) 
                  {
                     cc++;
                     openTrades--;
                  }//(result) 
                  if (!result) forceTradeClosure= true;
               }//if (OrderType() > 1) 
               
      }//for (int cc = ArraySize(fifoTicket) - 1; cc >= 0; cc--)
   }//for (int pass = 0; pass <= 1; pass++)
   
  
}//End void closeAllTrades(string symbol, int type)

void closeAllTradesFIFO(string symbol, int type)
{
   forceTradeClosure= false;
   
   if (OrdersTotal() == 0) return;

   bool result = false;
   for (int cc = ArraySize(fifoTicket) - 1; cc >= 0; cc--)
   {
      if (!betterOrderSelect(fifoTicket[cc], SELECT_BY_TICKET, MODE_TRADES) ) continue;
      if (OrderMagicNumber() != MagicNumber) continue;
      if (OrderSymbol() != symbol) 
         if (symbol != AllSymbols)
            continue;
      if (type != AllTrades)
      {
            if (type == OP_BUY)
               if (OrderType() == OP_SELL || OrderType() == OP_SELLLIMIT || OrderType() == OP_SELLSTOP)
                  continue;
            
            if (type == OP_SELL)
               if (OrderType() == OP_BUY || OrderType() == OP_BUYLIMIT || OrderType() == OP_BUYSTOP)
                  continue;
      
      }//if (type != AllTrades)
         
      
      //if (OrderType() != type) 
         //if (type != AllTrades)
           // continue;
      
      while(IsTradeContextBusy()) Sleep(100);
      if (OrderType() < 2)
      {
         result = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 1000, CLR_NONE);
         if (result) 
         {
            cc++;
         }//(result) 
         
         if (!result) forceTradeClosure= true;
      }//if (OrderType() < 2)
      
      if (OrderType() > 1) 
      {
         result = OrderDelete(OrderTicket(), clrNONE);
         if (result) 
         {
            cc++;
         }//(result) 
         if (!result) forceTradeClosure= true;
      }//if (OrderType() > 1) 
      
   }//for (int cc = ArraySize(fifoTicket) - 1; cc >= 0; cc--)


}//End void closeAllTradesFIFO(string symbol, int type)
:xm: :rocket:
Author:  SteveHopwood [ Sun May 10, 2020 3:38 pm ]
Post subject:  Moving Day

Last week was stunning:
last week.png
And since opening the demon on April 9th:
all history.png
Wow.

:xm: :rocket:
Author:  rapple [ Mon May 11, 2020 1:06 am ]
Post subject:  Moving Day

:good:

That is very impressive results Steve

I too am on the Moving Day band wagon and doing well

Thank you for sharing :clap: :clap: :clap:
Author:  luipogifx [ Mon May 11, 2020 12:45 pm ]
Post subject:  Moving Day

It's a Moving Day everyone!!!!

:cheer: :cheer: :cheer:
Author:  hamburglar [ Mon May 11, 2020 5:11 pm ]
Post subject:  Moving Day

Thank you for Moving day Steve.

Currently i have Moving day monitoring 21 pairs. Margin gets to be very low when today 6 pairs started trading and the grid starts to fill. Right now on a $6000 demo i am at 350% margin. As per the manual i have the lots set at .25. Is there a way we could have the bot limit the number of pairs allowed to trade at one time? It would make it easier to calculate risk.

As well when the GridSize is set to 5 it is sending 6 trades. I noticed this on your demo from the manual too.

Current floating open trades are $126 positive as i write this.

Moving more towards set and for get. Wonderful piece of inginuity.

thank you again.

Jim
Author:  SteveHopwood [ Mon May 11, 2020 8:13 pm ]
Post subject:  Moving Day

hamburglar » Mon May 11, 2020 5:11 pm wrote:Thank you for Moving day Steve.

Currently i have Moving day monitoring 21 pairs. Margin gets to be very low when today 6 pairs started trading and the grid starts to fill. Right now on a $6000 demo i am at 350% margin. As per the manual i have the lots set at .25. Is there a way we could have the bot limit the number of pairs allowed to trade at one time? It would make it easier to calculate risk.
I will add this.
As well when the GridSize is set to 5 it is sending 6 trades. I noticed this on your demo from the manual too.

Current floating open trades are $126 positive as i write this.

Moving more towards set and for get. Wonderful piece of inginuity.

thank you again.

Jim
MD sends the trigger trade and then a further grid of 5 stop orders by default. I have added a note to this to the user guide that I will upload when I have added the pairs trading limit code.

MD is not the same as the bot I started with. FYI, read the whole thread to see how members' suggestions have turned it into the monster it has become.

:xm: :rocket:
Author:  SteveHopwood [ Mon May 11, 2020 8:15 pm ]
Post subject:  Moving Day

luipogifx » Mon May 11, 2020 12:45 pm wrote:It's a Moving Day everyone!!!!

:cheer: :cheer: :cheer:
Yep.I started the week with a $400 global basket closure on my main trading account, $40 on a couple of smaller ones and $4,000 on the demo.

Happy start to the trading week. :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap:

:xm: :rocket:
Author:  Fourxxxx [ Tue May 12, 2020 6:28 am ]
Post subject:  Moving Day

Just set up Moving Day (apparently it is a thing in Quebec Canada 1st July every year) looking forward to seeing some wonderful results. I found this thread searching for code snippets for an EA (very rough and basic) I have been working on that is similar.

BTW I had to dig around to find the DrawClosedTrades and DrawOpenTrades indicators, they are here if anyone is looking.
viewtopic.php?p=155669#p155669
All times are UTC Page 9 of 18