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

jiva34's BB Stop auto-trader
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3
Page 11 of 16
Author:  SWG123 [ Mon Nov 21, 2011 1:22 pm ]
Post subject:  Re: jiva34's BB Stop auto-trader

jiva eu m5 111121_1505.gif
Another great start for jiva, +58 on EU M5.
Author:  Xfinity [ Mon Nov 21, 2011 1:34 pm ]
Post subject:  Re: jiva34's BB Stop auto-trader

bobasker wrote:Sure, no problem
Thanks! :D
Author:  Kimmy [ Mon Nov 21, 2011 5:01 pm ]
Post subject:  Re: jiva34's BB Stop auto-trader

A miserable day for the 1min TF just had my first win after a whole day of losses in this horrible day of chop since the London open,
16 losses and 1 win !!!!

How can we try to cut down on losses when we have days like today ?
Author:  gaheitman [ Mon Nov 21, 2011 5:03 pm ]
Post subject:  Re: jiva34's BB Stop auto-trader

There's a small error reporting issue in this bot, and perhaps others where it reports an error(0) no error when it is opening an order on an ECN AND the Sl and TP are set to 0. The procedure is:

Code: Select all

void ModifyOrder(int ticket, double stop, double take)
{
   //Modifies an order already sent if the crim is ECN.
   if (!OrderSelect(ticket, SELECT_BY_TICKET) ) return;//Trade does not exist, so no mod needed
   
   if (stop == 0 && take == 0) return; //nothing to do
   
   //RetryCount is declared as 10 in the Trading variables section at the top of this file   
   for (int cc = 0; cc < RetryCount; cc++)
   {
      for (int d = 0; (d < RetryCount) && IsTradeContextBusy(); d++) Sleep(100);
        if (take > 0 && stop > 0)
        {
           while(IsTradeContextBusy()) Sleep(100);
           if (OrderModify(ticket, OrderOpenPrice(), stop, take, OrderExpiration(), CLR_NONE)) return;           
        }//if (take > 0 && stop > 0)
   
        if (take != 0 && stop == 0)
        {
           while(IsTradeContextBusy()) Sleep(100);
           if (OrderModify(ticket, OrderOpenPrice(), OrderStopLoss(), take, OrderExpiration(), CLR_NONE)) return;
        }//if (take == 0 && stop != 0)

        if (take == 0 && stop != 0)
        {
           while(IsTradeContextBusy()) Sleep(100);
           if (OrderModify(ticket, OrderOpenPrice(), stop, OrderTakeProfit(), OrderExpiration(), CLR_NONE)) return;
        }//if (take == 0 && stop != 0)
   }//for (int cc = 0; cc < RetryCount; cc++)
   
   //Got this far, so the order modify failed
   int err=GetLastError();
   Print(Symbol(), " SL/TP  order modify failed with error(",err,"): ",ErrorDescription(err));               
   Alert(Symbol(), " SL/TP  order modify failed with error(",err,"): ",ErrorDescription(err));               

}//void ModifyOrder(int ticket, double tp, double sl)
I have added the line

Code: Select all

if (stop == 0 && take == 0) return; //nothing to do
at the top to handle the case when there is no TP and no SL specified for the order. The remainder of the code handled the other cases, but reported an error if the code made it to the end of the loop.

Just to be clear, there isn't a problem with order entry, it's just reporting that there isn't one. :>

EDIT: Feel free to make this change on your own, or wait till it gets rolled into some more important change.

George
Author:  SWG123 [ Mon Nov 21, 2011 9:04 pm ]
Post subject:  Re: jiva34's BB Stop auto-trader

Kimmy wrote:A miserable day for the 1min TF just had my first win after a whole day of losses in this horrible day of chop since the London open,
16 losses and 1 win !!!!

How can we try to cut down on losses when we have days like today ?
Try using ATR as a volatility filter. I do and it helps to keep me out of trading during wishy-washy market conditions. Stick it on today's chart and look back. For EU M1, 4 pips is a typical average level.

See how today's trading would have looked if you had kept out of the market when ATR was above 4 pips (i.e. 0.0004 in the indi)?

BTW, ATR default period is 14 - I like to use 8 - it's up to you but please experiment.
Author:  bobasker [ Mon Nov 21, 2011 9:24 pm ]
Post subject:  Re: jiva34's BB Stop auto-trader

Great day of trading, up 1%...

EU http://my.jetscreenshot.com/5637/201111 ... -165kb.jpg

AU http://my.jetscreenshot.com/5637/201111 ... -150kb.jpg

GU http://my.jetscreenshot.com/5637/201111 ... -156kb.jpg
Author:  bobasker [ Mon Nov 21, 2011 9:37 pm ]
Post subject:  Re: jiva34's BB Stop auto-trader

Kimmy wrote:A miserable day for the 1min TF just had my first win after a whole day of losses in this horrible day of chop since the London open,
16 losses and 1 win !!!!

How can we try to cut down on losses when we have days like today ?

Trade a higher time frame, you will catch more pips with less chop and unnecessary exposure.
Author:  SWG123 [ Mon Nov 21, 2011 9:53 pm ]
Post subject:  Re: jiva34's BB Stop auto-trader

bobasker wrote:
Kimmy wrote:A miserable day for the 1min TF just had my first win after a whole day of losses in this horrible day of chop since the London open,
16 losses and 1 win !!!!

How can we try to cut down on losses when we have days like today ?

Trade a higher time frame, you will catch more pips with less chop and unnecessary exposure.
Bob knows his stuff and I sort of agree with him, but there are some days when market swings will hurt you badly on the higher TFs too.

If you want to trade shorter TFs my personal mantra, which would have helped a lot today, is don't trade when price is stuck between daily open and pivot. Today it ranged there before breaking short around London open, bouncing off S1/yesterday's low, faffed around for ages, climbed back to the daily pivot and drifted down again. Plenty of pips to be made in the right direction. ;)
Author:  musky [ Mon Nov 21, 2011 11:33 pm ]
Post subject:  Re: jiva34's BB Stop auto-trader

Yes i can confirm forward in forward testing this does not like the 1 min time frame.
Author:  SteveHopwood [ Mon Nov 21, 2011 11:45 pm ]
Post subject:  Re: jiva34's BB Stop auto-trader

gaheitman wrote:There's a small error reporting issue in this bot, and perhaps others where it reports an error(0) no error when it is opening an order on an ECN AND the Sl and TP are set to 0. The procedure is:

Code: Select all

void ModifyOrder(int ticket, double stop, double take)
{
   //Modifies an order already sent if the crim is ECN.
   if (!OrderSelect(ticket, SELECT_BY_TICKET) ) return;//Trade does not exist, so no mod needed
   
   if (stop == 0 && take == 0) return; //nothing to do
   
   //RetryCount is declared as 10 in the Trading variables section at the top of this file   
   for (int cc = 0; cc < RetryCount; cc++)
   {
      for (int d = 0; (d < RetryCount) && IsTradeContextBusy(); d++) Sleep(100);
        if (take > 0 && stop > 0)
        {
           while(IsTradeContextBusy()) Sleep(100);
           if (OrderModify(ticket, OrderOpenPrice(), stop, take, OrderExpiration(), CLR_NONE)) return;           
        }//if (take > 0 && stop > 0)
   
        if (take != 0 && stop == 0)
        {
           while(IsTradeContextBusy()) Sleep(100);
           if (OrderModify(ticket, OrderOpenPrice(), OrderStopLoss(), take, OrderExpiration(), CLR_NONE)) return;
        }//if (take == 0 && stop != 0)

        if (take == 0 && stop != 0)
        {
           while(IsTradeContextBusy()) Sleep(100);
           if (OrderModify(ticket, OrderOpenPrice(), stop, OrderTakeProfit(), OrderExpiration(), CLR_NONE)) return;
        }//if (take == 0 && stop != 0)
   }//for (int cc = 0; cc < RetryCount; cc++)
   
   //Got this far, so the order modify failed
   int err=GetLastError();
   Print(Symbol(), " SL/TP  order modify failed with error(",err,"): ",ErrorDescription(err));               
   Alert(Symbol(), " SL/TP  order modify failed with error(",err,"): ",ErrorDescription(err));               

}//void ModifyOrder(int ticket, double tp, double sl)
I have added the line

Code: Select all

if (stop == 0 && take == 0) return; //nothing to do
at the top to handle the case when there is no TP and no SL specified for the order. The remainder of the code handled the other cases, but reported an error if the code made it to the end of the loop.

Just to be clear, there isn't a problem with order entry, it's just reporting that there isn't one. :>

EDIT: Feel free to make this change on your own, or wait till it gets rolled into some more important change.

George
George, I missed this when you posted it. I see it now and have added this to jive, although not posted, and to the generic, also not posted. There is time to add everything, eventually.

Cheers

:D
All times are UTC Page 11 of 16