HGB's Candle Power multi-pair combined trader and dashboard

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.

HGB's Candle Power multi-pair combined trader and dashboard

Post by SteveHopwood »

V 1h is in post 1, thanks to this post by syhchan:
syhchan wrote:Steve,

I think there are still 2 issues in using the high swap:
1) LongSwap and ShortSwap are duplicated. One set with lowercase (longSwap and shortSwap) which is storing the actual symbol swap info, and another one with Uppercase (LongSwap and ShortSwap) which is always zero and is used in the filter logic.

2) In IsTradingAllowed(),

Code: Select all

   if (OnlyTradeCurrencyTwice && OpenTrades == 0)
   {
      IsThisPairTradable(symbol);      
   }//if (OnlyTradeCurrencyTwice)
Should the "==" be ">" so that we check if the symbol is already in the trade only when we have open trade?

Regards,
Simon
Fixes should be in V 1h. Thanks Simon. :clap: :clap: :clap: :clap: :clap: :clap:
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.
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.

HGB's Candle Power multi-pair combined trader and dashboard

Post by SteveHopwood »

V 1i is in post 1. Simon has been sleuthing again. Thanks Simon; you have been enormously helpful. :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap:

Simon pointed out that OnlyTradeCurrencyTwice could not work as coded - and in fact would prevent an individual currency from being both bought and sold.

Here is my revised function so that DIYers can copy it over the top of the existing function. I have left the bad code commented out so you can see how it stopped the function working properly:

Code: Select all

bool IsThisPairTradable(string symbol)
{
   //Checks to see if either of the currencies in the pair is already being traded twice.
   //If not, then return true to show that the pair can be traded, else return false
   
   string c1 = StringSubstrOld(symbol, 0, 3);//First currency in the pair
   string c2 = StringSubstrOld(symbol, 3, 3);//Second currency in the pair
   int c1open = 0, c2open = 0;
   CanTradeThisPair = true;
   for (int cc = OrdersTotal() - 1; cc >= 0; cc--)
   {
      if (!BetterOrderSelect(cc, SELECT_BY_POS) ) continue;
////////if (OrderSymbol() != symbol ) continue;
      if (OrderSymbol() == symbol ) continue;//We can allow multiple trades on the same symbol
      if (OrderMagicNumber() != MagicNumber) continue;
      int index = StringFind(OrderSymbol(), c1);
      if (index > -1)
      {
         c1open++;         
      }//if (index > -1)
   
      index = StringFind(OrderSymbol(), c2);
      if (index > -1)
      {
         c2open++;         
      }//if (index > -1)
   
////////if (c1open == 1 && c2open == 1) 
      if (c1open > 1 || c2open > 1) 
      {
         CanTradeThisPair = false;
         return(false);   
      }//if (c1open > 1 || c2open > 1) 
   }//for (int cc = OrdersTotal() - 1; cc >= 0; cc--)

   //Got this far, so ok to trade
   return(true);
   
}//End bool IsThisPairTradable()
This prompted me to check our Zeljko filter. Do a search for "//This code courtesy of Zeljko (zkucera) who has my grateful appreciation." to find the correct function. You will see this line of code twice in the function:

if (type == OP_BUY || type == OP_BUYSTOP)

This will cause the 'else' code block that examines sell trades to treat buy limit trades as sells - doesn't matter here as we do not deal with limit orders but correct code is always better than incorrect code. These two lines of code should be:
if (type == OP_BUY || type == OP_BUYSTOP || type == OP_BUYLIMIT)

All of this is legacy code that has been around since the dawn of time and so will be present in every EA I have coded and all my shells. This is something for you codeslingers using my shells to correct.

----------------------

Noobs the point behind all this is: we do not want to become over-exposed to a single currency and risk our accounts if something unexpected happens. For example, on Friday I had buys open on three EURxxx pairs. If a 'black swan' event had occurred causing the Euro to tank, then all those buys would have turned into losers within seconds and probably wiped the account. Zeljko and OnlyTradeCurrencyTwice are sisters in arms against over-trading.

Our Zeljko filter would have allowed only one EURxxx buy - EURUSD buy for example - and prevented CP from buying any of the others. It would have allowed CP to sell EURxxx - EURCHF for example.

So now we have an EU buy and an EChf sell open. The black swan flaps its wings and EU screams towards Hell like a guided missile on a mission. At the same time, EChf screams towards the heavens like an angel with good news to convey. The position is balanced and the account is safe.

Now imagine that we have a CHFJPY buy trade open at the same time. This is where OnlyTradeCurrencyTwice steps in to prevent over exposure to an individual currency. We have an EU buy, and EChr sell and a CHFJPY buy. CP spots an opportunity to sell EURCHF but examines the existing trades first, spots that we are already exposed the the Swissy twice and prevents the EC trade from going ahead and increasing our risk.

None of this helps the tiny demo account I am trying to build if something happens to either the US or Canadian dollar. I have three UCad buys open and heading hot-foot towards closing at the peak high. A dramatic tank right now would probably blow the account. Trading such a tiny account (start balance $300, current balance $340) is stupidly risky so I repeat my mantra: never trade with funds you cannot afford to lose.

:xm:
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.
Sjakie
Posts: 1
Joined: Wed Feb 03, 2016 7:40 pm

HGB's Combined multi-pair combined trader and dashboard

Post by Sjakie »

SteveHopwood » Mon Nov 13, 2017 2:47 am wrote:

Useless freeloaders, wouldn't care to do some intelligent testing and so offer up some results would you? You know whom you are.

:xm:
:cheer:
Yeahhh!
:lol:
Been testing, though not intelligent enough yet.
Just to let you know, thanks!
:geek: :youknow: :cheer:
olric2000
Trader
Posts: 30
Joined: Fri Oct 30, 2015 12:01 pm
Location: Ankara

HGB's Candle Power multi-pair combined trader and dashboard

Post by olric2000 »

2017-12-02.png
Hi All,

I just like to share my results with you.
I've been testing CP multi pair version 1a with CP 5min 15 pips set file sine 8th of november.
As you see the picture is quite well and safe, no DD nightmare.
I am planning to go live next monday.
Thanks to all who has contribution to this wonderful forum.

Best,

Ahmet
You do not have the required permissions to view the files attached to this post.
User avatar
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

HGB's Candle Power multi-pair combined trader and dashboard

Post by Wavegarrick »

Hi Ahmet,

These results are simply spectacular in the big picture :good:

Just a few points: You had 5000 trades plus since the 08th of November. It can be risky if these trades go against you, so you must have a good back up plan or exit method?

Would you consider the same risk on a smaller live trading account?

Would you trade all currency pairs on offer when going live?

Anyway, nice Bud. Do keep us posted and can you post your set file?.

Many Thanks,
Cheers
Leon
WhoKnows
Trader
Posts: 102
Joined: Wed Mar 19, 2014 11:57 pm
Location: North Brisbane, Australia

HGB's Candle Power multi-pair combined trader and dashboard

Post by WhoKnows »

Very nice results, but I see that your trades made only an average of 2.6 pips profit per trade on Demo.
Unfortunately Demo platforms don't have any slippage etc. so demo results are often better than real results with most brokers. I found the hard way when going live. ;) Better keep a good eye on slippage.

Anyway, all the best Ahmet. May the Forex-force be with you.
olric2000
Trader
Posts: 30
Joined: Fri Oct 30, 2015 12:01 pm
Location: Ankara

HGB's Candle Power multi-pair combined trader and dashboard

Post by olric2000 »

Hi Leon, Whoknows,

Thank you for your comments.
Indeed I don't have deep understanding as yours on forex, so I had such bad experiences on EAs. They did good on demo but caused a lot of lost on live account. This time I thought I had given enough time to demo but I am still scared that november was highly volatile, on the other hand december would be range market which is not good for this EA...

As an exit plan; trades are closed on opposite HGI and SS signals, so sometime you could have looses.

For the live account I plan to use the same balance and lot size (0,01)...

I considered on limiting currency pairs. But Then I thought that it is again risky to limit, since if the pairs I choose goes against me I'll have lots of looses. That's why I decided to use all pairs with zeljko filter. I don't know if I am right?

You can find set file attached.

Whoknows you are right on the slippage, I'll follow it. By the way my broker is GP.

Anybody wants to say "hey body don't go live yet" I am ready to change my mind :)

Thank you all.
Best

Ahmet
You do not have the required permissions to view the files attached to this post.
User avatar
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

HGB's Candle Power multi-pair combined trader and dashboard

Post by Wavegarrick »

Hi Ahmed ,

Thanks for the detailed answer and the set file. :good:
I considered on limiting currency pairs. But Then I thought that it is again risky to limit, since if the pairs I choose goes against me I'll have lots of looses. That's why I decided to use all pairs with zeljko filter. I don't know if I am right?
You cannot go wrong with Zeljko and many thanks to Steve who has revisited Zeljko and given a detailed explanation on the dynamics of this filter.
Just another thought that crossed my mind is to set MinimumMarginPercent to true which can be very usefull for multi pair strats, nevertheless it is a personal choice.
Anybody wants to say "hey body don't go live yet" I am ready to change my mind :)
My personal opinion, if you are ready to take the plunge, then by all means go for it. Only you will know your risk tolerance, afterall it is your money. ;)

I will also do some testing on your set file and hopefully can give you some feedback, but in the meantime I follow your progress with interest.

Many thanks
Leon
olric2000
Trader
Posts: 30
Joined: Fri Oct 30, 2015 12:01 pm
Location: Ankara

HGB's Candle Power multi-pair combined trader and dashboard

Post by olric2000 »

Thank you Leon, I will keep you updates.
Cheers
User avatar
dreambig2
Trader
Posts: 46
Joined: Sat Nov 19, 2016 12:54 am
Location: US

HGB's Candle Power multi-pair combined trader and dashboard

Post by dreambig2 »

Thanks for the filter explanation above Steve....going to start checking them out. :)
Post Reply

Return to “Thingy Bob EA's”