Shelley's multi-pair basket trader

Share your 10.x automated traders here.
Post Reply
garyfritz

Re: Shelley's multi-pair basket trader

Post by garyfritz »

Zypip wrote:I thought that it could be useful if the EA could automatically exit any trades for which the TMA slope falls below the 0.8 value.
Along those lines, I've wondered -- instead of saying "open a basket at XX:YY time and see how that fixed basket works" -- how would it work if we say "run 24x5, open pairs when they get > 0.8, close pairs when they fall below 0.8" ?
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.

Re: Shelley's multi-pair basket trader

Post by SteveHopwood »

garyfritz wrote:
SteveHopwood wrote:If a jumping stop is, say, 50, then the profit has to reach 100 to lock in 50, then 150 to lock in 100 etc
JslPips initially gets set to BreakEvenProfitPipsLock. If we say BreakEvenProfitPipsLock is 60, then when PipsUpl > 2 * JslPips = 2 * 60 = 120, you add JumpingStopPips so now JslPips is 60 + 50 = 110. Now PipsUpl has to be > 220 to move JslPips to 110 + 50 = 160, > 320 to move to 160 + 50 = 210, > 420 to move to 210 + 60 = 260, etc. The JSL falls further and further behind the max PipsUpl.

It's clear that you'd better understand exactly how JSLs work, because there are plenty of innocent-looking values that wouldn't work very well. E.g. if you set BreakEvenProfitPipsLock to the same value as JumpingStopPips (or lower), the first time the JSL moves, it moves to the current price (or beyond it) and you'll get immediately stopped out.

Is that what you wanted? Or did you want the JSL to trail a fixed amount behind the max PipsUpl? I assumed JSL's worked something like "if (PipsUpl >= JslPips + 2*JumpingStopPips) JslPips += JumpingStopPips;" -- so the JSL is always between 1* & 2*JumpingStopPips behind the max PipsUpl.

BTW I see you store the JSL in a GV -- but you don't in JumpingStopLoss().
Thanks. I misunderstood your post. I had a bit of a logic fuzzie over this. I know it should be easy enough, but I don't muck around when fuzzying.

Does this look better?

Code: Select all

void JumpingStopLoss()
{

   if (PipsUpl >= JslPips + (JumpingStopPips * 2) )
   {
      JslPips+= JumpingStopPips;
      GlobalVariableSet(PipsTpGvName, JslPips);
   }//if (PipsUpl > JslPips * 2)
   
}//End void JumpingStopLoss()
D
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.
garyfritz

Re: Shelley's multi-pair basket trader

Post by garyfritz »

Looks better to me! But then it would, since I basically wrote it. :D
Caillou
Trader
Posts: 48
Joined: Sat Dec 03, 2011 9:11 pm

Re: Shelley's multi-pair basket trader

Post by Caillou »

garyfritz wrote:
Zypip wrote:I thought that it could be useful if the EA could automatically exit any trades for which the TMA slope falls below the 0.8 value.
Along those lines, I've wondered -- instead of saying "open a basket at XX:YY time and see how that fixed basket works" -- how would it work if we say "run 24x5, open pairs when they get > 0.8, close pairs when they fall below 0.8" ?
Really interesting........

Actually I´m up +200 pips using live the very first Shelley EA (without SL, without BE, without JS) but your thought makes much more sense to me.
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.

Re: Shelley's multi-pair basket trader

Post by SteveHopwood »

garyfritz wrote:Looks better to me! But then it would, since I basically wrote it. :D
Hehe. I didn't read that bit. :lol:
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.
garyfritz

Re: Shelley's multi-pair basket trader

Post by garyfritz »

Steve, I noticed the EA can now have status values like "Buy and hold. Sell." I was confused by that so I looked at the code and saw the "Buy and hold" means the TMA slope > 0.8, and the "Sell" means wo<ma i.e. the WOH is down. You might get fewer confused users if you changed the status line to something like "TMA: Buy and hold. WOH: Sell."

In LookForTradingOpportunities() I think you could simplify your code quite a bit. You may have reasons I don't know for doing it the way you do, but I believe you could replace 57 lines of code (lines 816-872 from "bool SendLong = false" through "}//if (!result)") with:

Code: Select all

type = -1;
//Slope must be buy and hold, WOH must be up; or sell and hold, WOH down
if (TradePair[cc][1] == buyhold  && TradePair[cc][2] == buy)  type = OP_BUY;
if (TradePair[cc][1] == sellhold && TradePair[cc][2] == sell) type = OP_SELL;
if (type > -1)
{
   bool result = SendSingleTrade(symbol, type, TradeComment, Lot, 0, 0);
   if (!result) BasketSent = false;
}//if (type > -1)
Personal taste I suppose, but I find the simpler/shorter code much easier to read, understand, and maintain.
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.

Re: Shelley's multi-pair basket trader

Post by SteveHopwood »

garyfritz wrote:Steve, I noticed the EA can now have status values like "Buy and hold. Sell." I was confused by that so I looked at the code and saw the "Buy and hold" means the TMA slope > 0.8, and the "Sell" means wo<ma i.e. the WOH is down. You might get fewer confused users if you changed the status line to something like "TMA: Buy and hold. WOH: Sell."

In LookForTradingOpportunities() I think you could simplify your code quite a bit. You may have reasons I don't know for doing it the way you do, but I believe you could replace 57 lines of code (lines 816-872 from "bool SendLong = false" through "}//if (!result)") with:

Code: Select all

type = -1;
//Slope must be buy and hold, WOH must be up; or sell and hold, WOH down
if (TradePair[cc][1] == buyhold  && TradePair[cc][2] == buy)  type = OP_BUY;
if (TradePair[cc][1] == sellhold && TradePair[cc][2] == sell) type = OP_SELL;
if (type > -1)
{
   bool result = SendSingleTrade(symbol, type, TradeComment, Lot, 0, 0);
   if (!result) BasketSent = false;
}//if (type > -1)
Personal taste I suppose, but I find the simpler/shorter code much easier to read, understand, and maintain.
Thanks Gary. I know you will not mind that I am not adopting this because:
  • - my code ain't bust so I ain't fixing it. Been down that route before and not going down it again. :lol:
    - it is my code, and I understand it. What others do is up to them.
Cheers

:D
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.
vivaldi
Trader
Posts: 58
Joined: Thu Feb 02, 2012 12:08 am
Location: Netherlands

Re: Shelley's multi-pair basket trader

Post by vivaldi »

garyfritz wrote:
Zypip wrote:I thought that it could be useful if the EA could automatically exit any trades for which the TMA slope falls below the 0.8 value.
Along those lines, I've wondered -- instead of saying "open a basket at XX:YY time and see how that fixed basket works" -- how would it work if we say "run 24x5, open pairs when they get > 0.8, close pairs when they fall below 0.8" ?


That was my next thought as well. The effect will be, that you enter a position in a currency at the moment it gets momentum and you keep it.
Another advantage is that you save the daily spreadcosts for everyday buying or selling it. It remains in the basket till conditions no longer prevail. On a yearly basis these costs could be considerable.

Vivaldi
Last edited by vivaldi on Mon May 28, 2012 6:00 pm, edited 2 times in total.
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.

Re: Shelley's multi-pair basket trader

Post by SteveHopwood »

Version 1k in post 1:
  • - see 'Basket Close Hours' in post 1.
    - adopted Gary's jumping stop loss fix.
    - adopted Gary's display suggestion.
:D
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.
4xSloPoke
Posts: 7
Joined: Wed May 23, 2012 6:52 pm
Location: Mountains, West Coast USA

Re: Shelley's multi-pair basket trader

Post by 4xSloPoke »

I must be doing something wrong, I've disabled TP, SL, BE and when Shelley places the trades (about 5-10 seconds later) they start closing. :cry:
I've tried setting large SL & TP but still the same thing , I would appreciate any help with v1k or can someone send me one of the earlier EAs before the j & k changes.

4xSloPoke
Post Reply

Return to “10.x EA forum”