Basket Trading BALUDA'S CSS Crossovers

The forum for stuff related to this method of trading. Baluda coded the indi. Bob devised the trading method.
Locked
User avatar
Gertje
Trader
Posts: 1936
Joined: Mon Dec 12, 2011 1:17 pm
Location: Middle of the Netherlands

Basket Trading BALUDA'S CSS Crossovers

Post by Gertje »

Took less than half an hour today......
I had the EA start at 7.59 in order to be ready to open a new set of trades at 8.00
The EA opened a set at 7.59 and again at 8.00 (Duh), and closed just before 8.30 when the basket TP of 2% is reached.
Done for the day.
image.png
You do not have the required permissions to view the files attached to this post.
MathiasJ
Trader
Posts: 146
Joined: Thu Mar 17, 2016 9:39 pm
Location: Sweden

Basket Trading BALUDA'S CSS Crossovers

Post by MathiasJ »

desi » 18 Oct 2016 08:39 wrote: It seemed to work, but it did not i.e., the alphabetical order. The EA got removed after a while.
I also tried with Include Symbols blank and that didn't work either as soon as I put the 8 symbols in the Exclude parameter.

Finally I am now using ExcludeCurrency feature with no CHF pairs.
I assume you have a suffix as well.
This seem to be a tricky area.
User avatar
TraderJoeForex
Trader
Posts: 1157
Joined: Fri Mar 08, 2013 10:29 pm
Location: South London

Basket Trading BALUDA'S CSS Crossovers

Post by TraderJoeForex »

Gertje » Tue Oct 18, 2016 8:32 am wrote:Took less than half an hour today......
I had the EA start at 7.59 in order to be ready to open a new set of trades at 8.00
The EA opened a set at 7.59 and again at 8.00 (Duh), and closed just before 8.30 when the basket TP of 2% is reached.
Done for the day.
Nice to bank your profit in time for breakfast :party: :clap:
User avatar
Gertje
Trader
Posts: 1936
Joined: Mon Dec 12, 2011 1:17 pm
Location: Middle of the Netherlands

Basket Trading BALUDA'S CSS Crossovers

Post by Gertje »

TraderJoeForex » Tue Oct 18, 2016 2:21 pm wrote:
Nice to bank your profit in time for breakfast :party: :clap:
Yup.
Makes the rest of the day a lot more peaceful..... :yahoo:

I've set the basket to TP@2% and close up shop than.
No need to expose myself more than necessary.
2% a day for a few months makes a killing....
desi
Trader
Posts: 35
Joined: Mon Jun 11, 2012 5:42 am
Location: Canada

Basket Trading BALUDA'S CSS Crossovers

Post by desi »

MathiasJ » Oct 18th, '16, 05:15 wrote:
I assume you have a suffix as well.
This seem to be a tricky area.
Nope, I was talking about GP demo.
User avatar
Boulder
Trader
Posts: 115
Joined: Sun Feb 28, 2016 5:16 pm
Location: Belgium

Capital Protection

Post by Boulder »

Hey guys,

I have 6 instances running and all 6 of them are killing it for now. Here's one with multi-trades and a news-filter to my own taste on.
Screen Shot 2016-10-18 at 18.17.22.png
Mathias to answer your question, this particular instance was left alone after its initiation. As you can see in the screenshot, we have 3 basketTPs there. Given that BasketTP = 3% and our starting balance of 1800 EUR, we should actually (theoretically) have reached 1800*(1.03)^3 = 1966.91 EUR after 3 basketTPs (i.e. 3% compounded 3 times becomes 9.27%). In casu we have reached 7.1%. So there is definitely something missing at the moment.

Furthermore some thoughts I’d like to share with you and everyone else as well. As I saw the “GBP flash crash” happen not too long ago I thought to myself: “These things are starting to happen too often for my taste”. It reminded me of a phrase of wisdom I read somewhere along the lines of “It’s not about how much you make in these markets, but how much you can protect over time”.

Thus in order to protect our capital, 3 things come to mind.


1. Exits

You need to get out when things are not going according to plan – i.e. you need an exit mechanism of some sort. Be it in the form of a SL, a basket-SL or other exit conditions. A recovery mechanism is also possible but there should be a point where it might be wise to consider bailing out in order not to risk blowing your entire account. However, what intruiges me most is the issue of markets moving so fast that even a SL is not strictly respected.

I had a talk with Global Prime’s customer service yesterday and the nice sir/lady explained to me what exactly happens in such situations. Global Prime’s ECN structure has actually got a spread-protection mechanism in place that will kick in once the spread becomes larger than 100 pips. This has to do with liquidity providers pulling back etc. So as a market plummets and the spread goes wild and over 100 pips, your stop-loss won’t be respected as Global Prime wants to protect its clients by not having them get stopped out by such excessive spreads. You will however get taken out at the next-best price as soon as possible (due to liquidity providers coming in again and the spread calming down etc.).

An idea I had was to have some sort of ‘flooding’-mechanism in place that OnTick() “brute forces” trades that went past their SL to get out asap. As it turns out, this is redundant as Empty4 and GP will take care of that to the best of their ability.

In my case I’m using CSSDiff{H4} on the other side of a trade as exit mechanism. However apart from that, my plan for the upcoming weeks is to see how well this works and how soon on average bad trades are taken out. The idea is to acquire a good feel for a ATR-based stop loss ratio for individual trades. The ultimate goal then is to equip every single trade with a sufficiently big and far away SL such that we’ll barely see this SL get triggered by the market as the CSSDiff{H4}-exit condition should be triggered long before we reach this SL. Again, this just as another security mechanism in order to be ready should an extreme move happen and potentially blow our account to tiny bits. One can’t be prudent enough.

Towards the end of our conversation the nice sir/lady on GP’s side kindly reminded me that we should watch our market exposure at all times! Being excessively exposed is what usually massacres an account (and not even necessarily only during these extreme moments). This brings me to my second point.


2. Market Exposure

Especially because I'm intending to let this run 24/5, it is of the utmost importance to have an understanding of the level of exposure I'm getting myself into.

Let's concentrate on the multi-trade instances for a second. I allow a maximum of 3 trades per pair per hour if the entry conditions are valid. This can get quite heavy and - especially with 1:100 leverage - quickly deplete margin such that one can't take any opportunities on pairs that are about to embark on nice trends and big moves. That's why I reduced my "pair exposure" with one more unit (i.e. trade every currency exactly 4 times instead of 5 times). This comes down to trading 16 pairs instead of 20, determined by the same method I described a few posts back (I opted to exclude AUDCHF,NZDUSD,EURJPY,GBPCAD).

Furthermore we should keep a healthy MinTradeMarginLevel = 500 (this should be even higher perhaps) and a healthy lot sizing policy! Currently I'm probably going in a bit too heavy with these settings:
Screen Shot 2016-10-18 at 18.47.47.png
If this proves to be indeed a bit too heavy I'll reduce the lot factor to 1.5 or even to 1. Currently my margin level is below 500% (i.e. won't be taking any more trades) and I have 0.43 lots active on a nearly 2000 EUR account. Also I'm exposed to 10 out of 16 pairs and must say pretty equally balanced out w.r.t. the 8 currencies too. I can live with this for now but if I feel the DD gets too uncomfortable I'll raise the MinTradeMarginLevel to about 700% and reduce the lot factor.
Screen Shot 2016-10-18 at 19.03.05.png
3. Black Swan Protection Mechanism (BSPM)

This the main point I wanted to discuss with you guys and asked Mathias to post this here so we could see what the opinions are around this matter. It should be wortwhile to think about implementing a ‘Black Swan Protection’-modus. Once the EA detects a Black Swan happening, IMO it should be a sensible idea for the EA to go into a - as it were - different 'mindset'.

How to go about this? A good start would be to research the 3 recent Black Swans we traders went through, i.e.:
  • Swiss unpegging CHF from EUR (15.01.2015)
  • Brexit (23.06.2016)
  • GBP flash crash (07.10.2016)
'Luckily' these potentially account-shredding events have 3 characteristics in common:
  • They happen extremely FAST (just a matter of minutes)
  • They travel a VAST distance.
  • The spread becomes HUGE.
So what can we do? Perhaps something along these lines:

Black Swan detection
First declare the following parameters:
  • BlackSwanSpread (type double) = 100 pips
    BlackSwanLookBackMinutes (type date?) = 60 minutes
    BlackSwanPercentageMove (type double) = 0.05 (i.e. 5%)
A Black Swan officially occurs when:
  • ridicilous spreads are detected: if CurrentSpread >= BlackSwanSpread
    or
  • a market makes a BIG move in terms of percentages (default 5%) in either direction within say the hour (BlackSwanLookBackMinutes = 60). OnTick:
    • Upwards move: if CurrentPrice/LowestLow[0;60] >= 1.05
      i.e. (1 + BlackSwanPercentageMove)
    • Downwards move: if CurrentPrice/HighestHigh[0;60] <= 0.95
      i.e. (1 - BlackSwanPercentageMove)
Black Swan measures
If either of these 2 things are happening, then unambiguously something's up. Now we also know that it'll happen simultaneously on all pairs that share the same currency. So during the CHF fiasco of 2015 for example, all CHF pairs would display 'Black Swan DETECTED' practically at exactly the same moment. So the algorithm should actually collect this common currency and declare it as a 'Black (Swan) Currency'. The moment we catch such a Black Currency, it is to be placed in a list (or array) for 'Black Currencies' which is visible in the EA configuration screen. At first initiation of the EA, we'd only see a blank line 'Black Currencies detected' here which is not to be played with as it is intended for the EA itself to add Black Currencies once they're detected. After the EA has detected and transferred this currency to this list, then only after manual removal by the user (as he/she deems that things have calmed down) regular trading on this currency resumes. As such, we would only be removing a currency from this list once we want to resume trading it again.

Because this Black Currency made its pairs go into full volatility mode or the spread became outrageous, there are actually only a few scenarios to account for (Specifically for basket trading).

Black Currency detected and open trades. Among open trades there is at least 1 Black Currency trade
  • Black Currency trades were on the right side and we hit BasketTP ---- Stop trading altogether until Black Currency is removed from the list.
  • Black Currency trades were on the wrong side and either:
    • 1. Black Currency trades are taken out by the exit-mechanism ---- stop taking trades on Black Currency pairs but keep trading on the non-Black Currency pairs.
      2. Black Currency trades are taken out by their individual SL ---- stop taking trades on Black Currency pairs but keep trading on the non-Black Currency pairs.
      3. We hit the BasketSL ---- Stop trading altogether until Black Currency is removed from the list.
Black Currency detected and open trades. Among open trades there are no Black Currency trades
In this case; stop taking trades on Black Currency pairs but keep trading on the non-Black Currency pairs.

Black Currency detected and no active trades
This would be the easiest scenario to handle; Stop trading altogether until Black Currency is removed from the list.

As a nice extra it would be cool if we could opt for an email or push-notification that sends a message (e.g. in the case of CHF):

"BLACK SWAN DETECTED on CHF! You still have active CHF-trades." or "BLACK SWAN DETECTED on CHF! Don't worry you haven't got any active CHF-trades."
Then when one of the aforementioned scenarios happens, another message that goes:
"You are not exposed to CHF anymore. Since the detection of the Black Swan you made XXXX EUR (profit or loss) and your balance is XXXX EUR."

Hope I'm not pushing it with that last one hehe :) In any case if we could get this last BSPM-module implemented too somehow along with all the other points I mentioned, then I really don't see any other measures anymore we could take to protect our capital apart from exercising discretion in anticipation of big and obvious events that should be avoided due to their potentially disastrous volatility (e.g. Brexit, upcoming presidential elections, etc.) It would truly become a most complete EA (not to forget that there are already some great protection measures in place already such as MaxSpread, Time (in seconds) between trades of the same pair, news-filter etc.) Of course I understand that it won't be an easy task at all coding such a complex beast and it'll be especially tricky due to the fact that we can't really test it until an actual Black Swan happens. But still hope you see the value in having such a thing in place..


Cheers guys

Aram
You do not have the required permissions to view the files attached to this post.
MathiasJ
Trader
Posts: 146
Joined: Thu Mar 17, 2016 9:39 pm
Location: Sweden

Basket Trading BALUDA'S CSS Crossovers

Post by MathiasJ »

desi » 19 Oct 2016 00:03 wrote:
MathiasJ » Oct 18th, '16, 05:15 wrote:
I assume you have a suffix as well.
This seem to be a tricky area.
Nope, I was talking about GP demo.
Can you send me the setfile?
User avatar
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Capital Protection

Post by tomele »

Hi Aram,

this scenario is a risk as well as a chance. There is always a retrace that you can ride.

Assume you had a grid of pending sells in place when the GBP plunge happened. They got filled somewhere on the way down to peak low. Worst case, all at the peak low. Now if your EA is smart enough to place a huge grid of pending buys from the peak low back to the new price range, you will make a fortune. Your EA has to be fast as well as your broker has to be honest. Latter I take assured with GP. Rest is coding.

My 2 cents.
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
MathiasJ
Trader
Posts: 146
Joined: Thu Mar 17, 2016 9:39 pm
Location: Sweden

Capital Protection

Post by MathiasJ »

Boulder » 19 Oct 2016 00:37 wrote:Hey guys,

I have 6 instances running and all 6 of them are killing it for now. Here's one with multi-trades and a news-filter to my own taste on.


Mathias to answer your question, this particular instance was left alone after its initiation. As you can see in the screenshot, we have 3 basketTPs there. Given that BasketTP = 3% and our starting balance of 1800 EUR, we should actually (theoretically) have reached 1800*(1.03)^3 = 1966.91 EUR after 3 basketTPs (i.e. 3% compounded 3 times becomes 9.27%). In casu we have reached 7.1%. So there is definitely something missing at the moment.

...

Cheers guys

Aram
Hi Aram!
You really give us a lot to digest! :)
To your response now: Something happens after second basket. You have a big loss there.
Could it be that one or more trades are closed by ExitCriteria and that actually was the only trades opened in that basket?
In that case you actually had four baskets but basket number 3 was closed at a loss due to ExitCriteria and maybe News settings. After that a new basket was started and finished.
Can you confirm if my analysis is correct?

Edit: Another verification: Is this the only EA running on that account?
BR
Mathias
User avatar
Boulder
Trader
Posts: 115
Joined: Sun Feb 28, 2016 5:16 pm
Location: Belgium

Capital Protection

Post by Boulder »

tomele » Wed Oct 19, 2016 1:02 am wrote:Hi Aram,

this scenario is a risk as well as a chance. There is always a retrace that you can ride.

Assume you had a grid of pending sells in place when the GBP plunge happened. They got filled somewhere on the way down to peak low. Worst case, all at the peak low. Now if your EA is smart enough to place a huge grid of pending buys from the peak low back to the new price range, you will make a fortune. Your EA has to be fast as well as your broker has to be honest. Latter I take assured with GP. Rest is coding.

My 2 cents.
Hey Thomas appreciate your input here!
Yes indeed that would very much be a great outcome. You'd indeed also need your SELLs to be exited at some point if the retrace is about to come. However I'd imagine this to be a very hard task because of the sheer speed with which things happen during Black Swans. Also another trouble I imagine is the spread that can be of annoyance here. Since the spread gets ridicilously high here during these events and as the market plummets and collects these SELLs - and afterwards the BUYs as it recovers - it can get quite expensive in the end.. Not to mention the problems with slippage you could experience since these events happen extremely fast.

Those are also arguments to rather suggest that one wouldn't be unwise to stay out of these rare events, after a certain contingent (e.g. a basketTP, basketSL, etc.) is achieved until things settle down a bit and normal trading conditions emerge again.

Cheers mate

Aram
Locked

Return to “BALUDA'S SUPER CSS-2.0. THE SIMPLEST TRADING SYSTEM EVER”