Nanningbob 10.2 Autotrader's new home

Share your 10.x automated traders here.
Post Reply
Riddermark
Trader
Posts: 13
Joined: Mon Jul 23, 2012 1:42 pm

Re: Nanningbob 10.2 Autotrader's new home

Post by Riddermark »

Hi Rapheal,

Memory is very manageable for 32 pairs. About 291K on Windows Vista listed under Task Manager. Partial close not enabled.

Best regards.
forex.rapheal wrote:Hi Riddermark,
excellent result. do you use the EA for all fx pairs? (i.e. you open 32 tab in a single Empty4) it seems it takes a lot of memeory. Also, did you turn on the "partial close" function?
regards,
Image
jlcgarcia

Re: Nanningbob 10.2 Autotrader's new home

Post by jlcgarcia »

Lifesys wrote:Hi Alex
I have not really trialled this EA yet as it seems too unstable, however looking through the code, one contribution I might make it to render the PartClose section actually operable.
I use fractional PartClose in MPTM for all my trading & have discussed same with Steve H.
It can work in this EA but as is, rather pointless to have PartCloseEnabled = false, with CloseLots =0.5 & PreserveLots =0.5 when Lots default is 0.06 (or anything) bearing no relation to the CloseLots values.
Using fractional PartClose one can set the Lots higher and watch partial close, break even & almost all trades close in profit. [Close_LotsFraction can be any value 0 - 1.]

In declaration section change -

Code: Select all

extern string  pcbe  ="PartClose settings can be used in";
extern string  pcbe1 ="conjunction with Breakeven settings";
extern bool    PartCloseEnabled    = true;
//extern double  Close_Lots           = 0.5;
//extern double  Preserve_Lots       = 0.5;
extern double  Close_LotsFraction = 0.4; // 40% closes, 60% continues after B/E
       double  Close_Lots, Preserve_Lots;

then in init() procedure replace

Code: Select all

	   
/* 
   //check Partial close parameters
   if (PartCloseEnabled == true)
   {
      if (Lot < Close_Lots + Preserve_Lots || Lot < MarketInfo(Symbol(), MODE_MINLOT) + Close_Lots )
      {
         Alert(Symbol()+" PartCloseEnabled is disabled because Lot < Close_Lots + Preserve_Lots or Lot < MarketInfo(Symbol(), MODE_MINLOT) + Close_Lots !");
         PartCloseEnabled = false;
      }//if (Lot < Close_Lots + Preserve_Lots || Lot < MarketInfo(Symbol(), MODE_MINLOT) + Close_Lots 
   }//if (PartCloseEnabled == true)
*/    
// replace with
   //check Partial close parameters
   if (PartCloseEnabled == true)
   {
      if (Close_LotsFraction < 0 || Close_LotsFraction > 1)
      {
         Alert(OrderSymbol()+" PartCloseEnabled is disabled because 'Close_LotsFraction' is outside range 0-1 ");
         PartCloseEnabled = false;
      }
      else {
         Close_Lots = MathFloor(Close_LotsFraction * OrderLots() * 100) / 100;
         Preserve_Lots = OrderLots() - Close_Lots;
      }  // if (Close_LotsFract) < 0
   }//if (PartCloseEnabled == true)

Hi Lifesys,

I would like to add this code to my version of Nanningbob, but I think there is a bug as you are using a function OrderLots(), that you are putting in the init() section.

Please, let me know if I am mistaken.

Regards


José Luis
User avatar
hansnl
Trader
Posts: 101
Joined: Sun May 20, 2012 3:18 pm
Location: Rotterdam Netherlands

Re: Nanningbob 10.2 Autotrader's new home

Post by hansnl »

Riddermark wrote:Please note errors. CHFJPY opened 3 pairs. My settings were OnlyTradeCurrencyTwice = True. Also set UseCorrelationFilter = True, HighCorrelation = 80. See attached pic and .set file. Manually closed all 3 to attempt to temporarily fix problem.

Best regards.
http://screencast.com/t/MqXDNu9etc3

Hi Riddermark,
Same problem overhere 9 ! WPC positions opened in one second :o

still a tricky bug there .....

version 10.2
jlcgarcia

Re: Nanningbob 10.2 Autotrader's new home

Post by jlcgarcia »

hansnl wrote:
Riddermark wrote:Please note errors. CHFJPY opened 3 pairs. My settings were OnlyTradeCurrencyTwice = True. Also set UseCorrelationFilter = True, HighCorrelation = 80. See attached pic and .set file. Manually closed all 3 to attempt to temporarily fix problem.

Best regards.
http://screencast.com/t/MqXDNu9etc3

Hi Riddermark,
Same problem overhere 9 ! WPC positions opened in one second :o

still a tricky bug there .....

version 10.2

Hi,

I think the bug is in the section

bool IsThisPairTradable()
{...


and the sentence

if (!MagicNumberTest() ) continue;

must be deleted.

Regards


José Luis
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: Nanningbob 10.2 Autotrader's new home

Post by gaheitman »

jlcgarcia wrote:
hansnl wrote:
Riddermark wrote:Please note errors. CHFJPY opened 3 pairs. My settings were OnlyTradeCurrencyTwice = True. Also set UseCorrelationFilter = True, HighCorrelation = 80. See attached pic and .set file. Manually closed all 3 to attempt to temporarily fix problem.

Best regards.
http://screencast.com/t/MqXDNu9etc3

Hi Riddermark,
Same problem overhere 9 ! WPC positions opened in one second :o

still a tricky bug there .....

version 10.2

Hi,

I think the bug is in the section

bool IsThisPairTradable()
{...


and the sentence

if (!MagicNumberTest() ) continue;

must be deleted.

Regards


José Luis
I don't think so, that line is making sure that the trade being checked is being managed by this EA. If you removed it, it would still work the same if you were only trading this EA, but if you had other EAs on this account, it would include them in the check. Of course, that may be what you want. :)


Alex,

Can we add a debug statement to see why we are closing the tickets? Something like this in LookForTradeClosure():

(replace existing "bool result = CloseTrade(TicketNo)" line with)

Code: Select all

      //document reason for closing trade
      OrderPrint();
      Print(Symbol(),": ","Closing Trade #",OrderTicket()," ("+OrderMagicNumber()+") B/T/S: ",Bid,"/",take,"/",stop);
      bool result = CloseTrade(TicketNo);
      OrderPrint();
You should also probably change the call to CloseTrade() to use the parameter "ticket" that you pass to the function instead of the global TicketNo, or use OrderTicket() as I did in the print statement. Globals like TicketNo make me nervous.

George
jlcgarcia

Re: Nanningbob 10.2 Autotrader's new home

Post by jlcgarcia »

jlcgarcia wrote:
hansnl wrote:
Riddermark wrote:Please note errors. CHFJPY opened 3 pairs. My settings were OnlyTradeCurrencyTwice = True. Also set UseCorrelationFilter = True, HighCorrelation = 80. See attached pic and .set file. Manually closed all 3 to attempt to temporarily fix problem.

Best regards.
http://screencast.com/t/MqXDNu9etc3

Hi Riddermark,
Same problem overhere 9 ! WPC positions opened in one second :o

still a tricky bug there .....

version 10.2

Hi,

I think the bug is in the section

bool IsThisPairTradable()
{...


and the sentence

if (!MagicNumberTest() ) continue;

must be deleted
if you are using

/Remember to add new magic numbers to bool MagicNumberTest() and InsertTakeProfit functions
extern string mns="----Magic numbers and trade comments----";
extern string ams="----enter 0 to autocal magic number-----";
extern int D1TrendTradeMN=0;
extern string D1TrendTradeComment="D1 trend trade";
extern int D1H4TrendTradeMN=0;
extern string D1H4TrendTradeComment="D1/H4 trend trade";
extern int BbRangeTradeMN=0;
extern string BbRangeTradeComment="Bb range trade";
extern int WpcRangeTradeMN=0;
extern string WpcRangeTradeComment="WPC range trade";


because the program will generate different magic numbers for each pair and type of trade.


Regards


José Luis
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: Nanningbob 10.2 Autotrader's new home

Post by gaheitman »

jlcgarcia wrote: if you are using

/Remember to add new magic numbers to bool MagicNumberTest() and InsertTakeProfit functions
extern string mns="----Magic numbers and trade comments----";
extern string ams="----enter 0 to autocal magic number-----";
extern int D1TrendTradeMN=0;
extern string D1TrendTradeComment="D1 trend trade";
extern int D1H4TrendTradeMN=0;
extern string D1H4TrendTradeComment="D1/H4 trend trade";
extern int BbRangeTradeMN=0;
extern string BbRangeTradeComment="Bb range trade";
extern int WpcRangeTradeMN=0;
extern string WpcRangeTradeComment="WPC range trade";


because the program will generate different magic numbers for each pair and type of trade.


Regards


José Luis
You are correct, it will generate magic numbers using a suffix and the symbol(), so it won't catch those. Do we know if the OP was using the autogen feature?

George
jlcgarcia

Re: Nanningbob 10.2 Autotrader's new home

Post by jlcgarcia »

Riddermark wrote:Please note errors. CHFJPY opened 3 pairs. My settings were OnlyTradeCurrencyTwice = True. Also set UseCorrelationFilter = True, HighCorrelation = 80. See attached pic and .set file. Manually closed all 3 to attempt to temporarily fix problem.

Best regards.

Hi,

I have tried to resolve some issues, mainly the PartialClose trades, and the number of pairs opened.
At the moment my version is not opening multiple identical pairs. Also be careful with the magic numbers (not put 0 in them), because there are bugs.

I am posting here my version, with the proposal that it can be useful to Alex for catching bugs.

Regards


José Luis
Nanningbob 10.2 autotrader PartialClose Balanced.mq4
You do not have the required permissions to view the files attached to this post.
Riddermark
Trader
Posts: 13
Joined: Mon Jul 23, 2012 1:42 pm

Re: Nanningbob 10.2 Autotrader's new home

Post by Riddermark »

Hi José,

Thanks for this version. Giving it a test now. Anything notable comes up I will list it here.

Best regards.
jlcgarcia wrote:
Riddermark wrote:Please note errors. CHFJPY opened 3 pairs. My settings were OnlyTradeCurrencyTwice = True. Also set UseCorrelationFilter = True, HighCorrelation = 80. See attached pic and .set file. Manually closed all 3 to attempt to temporarily fix problem.

Best regards.

Hi,

I have tried to resolve some issues, mainly the PartialClose trades, and the number of pairs opened.
At the moment my version is not opening multiple identical pairs. Also be careful with the magic numbers (not put 0 in them), because there are bugs.

I am posting here my version, with the proposal that it can be useful to Alex for catching bugs.

Regards


José Luis
Nanningbob 10.2 autotrader PartialClose Balanced.mq4
Image
User avatar
fxjoe2
Posts: 7
Joined: Wed Aug 08, 2012 7:49 am

Found the cause of high memory Usage of Autotrader 1.X

Post by fxjoe2 »

Hi All

I'm very excited by this EA. Big thank you to all who had designed, created and grew this thus far.

Maybe my opportunity to contribute a bit.

I am testing Autotrader version 1.2 and 1.3a on 7 Empty4 instances. ( 7 X 27pairs)
5 of these Demo and 2 Live accounts.
I am aware of the risks, but in my experiece, I treat a small live accounts with much more respect and discipline than larger demo accounts. So in a sence the only way for me to really test a system is to commit real monies. I tend to housekeeping much more diligently.

The memory profile of each of these 7 instances of Empty4 started of around 640Mb. I Had to go and buy more memory for my test server.
I then started trying to find the direct cause of the masisve footprint, suspecting indicators and the EA itself.

It turned out to be the 2 settings in Empty4 are the overwhelming contributors to the size of memory used per Empty4 instance.

TOOLS|OPTIONS|CHARTS| Max bars in history: - brought down to 100 000
(from maximum (2147483647))
&
TOOLS|OPTIONS|CHARTS| Max bars in chart: - brought down to 100 000
(from maximum(2147483647))

In hind sight this should have been obvious I suppose ..... :oops:

I now have an avearge Empty4 memory footprint of 130Mb and find the trading environment much more stable.

Hope this helps someone else out there.

My trading results thus far echo the positve feedback in this thread.

Blessings
FXJoe
Image
Post Reply

Return to “10.x EA forum”