my journal 2

Status
Not open for further replies.
I had a nightmare or something like that, and I woke up and now I can't go back to sleep.

I drank some wine, but not enough to knock me out.

I will put the JuneYankee audio, but whereas she will tell me to be "utterly relaxed" I will still feel utterly frustrated.

Time is ticking and I haven't achieved enough. Anxiety is growing.

Day after day, year after year, decade after decade, I am always at the office.

This is not good.

With the new boss, I don't even have a choice of whether to go or not to go: there's no familiarity nor friendship. Besides, he is not even the one allowing me to take vacation hours/days without warning him, but it's yet another guy... higher up in the ladder. I just have to go to work, whether I slept or not.

Which means I just have to go to sleep, whether I have things to think about or not. Yet whenever I am awake I feel that I have things to think about.

You see, at 4 am you feel you have things to think about, because you don't see it as the end of yesterday but as the beginning of today. So... it's the worst thing to wake up at 4 am. 3 am, you'd still see it as yesterday, but this is today.

You get my point.

"...utterly relaxed..."... but i am not, as I am still typing.
 
Last edited:
insomnia keeps happening

No matter what the office, whether on vacation or not... every once in a while I'll wake up or not go to bed and... maybe it's a rebellion against having to go to sleep, which you're basically forced to do ever since you're a child.

Every once in a while I'll wake up and just stay up, thinking. I can't help it. I've drank wine, taken pills, listened to hypno-audios... nothing to do.

I'll work on a sharpe ratio and drawdown formulas on my excel workbook. I will have to tell the new boss and the other guy that I was sick, since they won't be happy with a sudden request for a day of vacation. They usually prefer if you say that you're sick. And that's what I'll do.
 
Last edited:
un giorno credi

http://www.youtube.com/watch?v=UaPvr0wFwV0

It reminds me of my childhood.

Un giorno credi di esser giusto
e di essere un grande uomo
in un altro ti svegli e devi
cominciare da zero.

Situazioni che stancamente
si ripetono senza tempo
una musica per pochi amici
come tre anni fa.

A questo punto non devi lasciare
qui la lotta è più dura ma tu
se le prendi di santa ragione
insisti di più.

Sei testardo, questo è sicuro
quindi ti puoi salvare ancora
metti tutta la forza che hai
nei tuoi fragili nervi.

Quando ti alzi e ti senti distrutto
fatti forza e vai incontro al tuo giorno
non tornar sui tuoi soliti passi
basterebbe un istante.

Mentre tu sei l'assurdo in persona
e ti vedi già vecchio e cadente
raccontare a tutta la gente
del tuo falso incidente.
 
Last edited:
it's 13.25

I didn't go to work. The cleaning lady just came.

She opened the shades as usual, in the kitchen.
 
it's 15.02

This week there has been no trades from the systems yet, in terms of real trades. Probably there will be a trade in about one hour. Actually for sure.
 
it's 16.25

The lady next door is singing stupid crap to her baby.

I am relieved that the first trade of the week was made, by GBL_ID, and it's making 150 dollars already.

I am sad that it hasn't been made on my account, because, with the trade from Friday, it would have been a total of 800 dollars now.

But hey, I asked to be monitored and regulated by the investors turned auditors, so... anyway, the previous accounts were blown out repeatedly so no more complaining about this nor regrets.

The lady keeps singing stupid **** to her baby.

It's 16.37. If no one minds I will take a long break from the journal. I will be back in a few hours.
 
Last edited:
Erich Warsitz

fascinating...

http://en.wikipedia.org/wiki/Erich_Warsitz
http://en.wikipedia.org/wiki/Heinkel_He_176



http://en.wikipedia.org/wiki/Fritz_von_Opel




http://en.wikipedia.org/wiki/Me-262



http://en.wikipedia.org/wiki/Hans_Guido_Mutke
It is claimed that Mutke made the very first flight breaking the sound barrier in 1945, in a Me 262, though this claim is subject of controversy. Mainstream opinion continues to regard Chuck Yeager in his Bell X-1 as the first person achieving this milestone in 1947.

 
Last edited:
it's 11.35

It's 11.35 and I have 2 big concerns right now:

1) I might have to go to the dentist, but I am postponing it merely because of... not really because of money, but for the same reason everyone postpones going to the dentist: pain, trouble... basically you don't even know if these are really finding any problems in your mouth or if they just say there's something wrong with it just to charge you some money. So, I am not feeling pain, and I have been postponing it. I am feeling some teeth itching or whatever you call it. But maybe I am also getting fixated on them, and it will go away as soon as I don't focus on it.

2) There was no reports coming in from the branches for over 4 days. In 4 days I have not received any reports... actually just 1 report, today. This is not normal. I hope it's not the Vito Chimp who thought of a new sick joke: let's hide the reports for a week, and then let's give them to him all at once. I usually get about 5 reports per day, so I should have received 25 reports this week, but I only got 1. Maybe it's because of the recent holidays or maybe it is indeed a joke by the Chimp.

Together with the tooth-itch, and the reports, there's two more things making me nervous. The neighboress woke me up 20 minutes before my alarm went off by slamming the door. So I both slept 20 minutes less, and I am mad at the bitch, as always.

Finally, soon I might get into a fight with the investors and be by myself all over again. It depends on them, if they can bear with my questions. So let's put it like this: they might get into a fight with me.

If all hell breaks loose, I will be left with my own little account, and roughly 5k to invest, which is close to the situation i was in when in 2008 I turned 3500 into 24k in less than 4 months. With the difference that now I have a clear idea of what my best systems are, and I have more of them: largely thanks to this collaboration with the investors. So it was a good experience, even if now they have all my systems, which sucks.

So, recapitulating, if all hell breaks loose, I am ready to go for another calculated gamble, like three years ago, with the difference that now I am a much better automated trader than I was then.

I'd need to bring my 5k to about 20k, before being able to slow down. I think I could do it in about 2 months.

Here's what I would do. I would first of all wait for a big loss by the GBL_ID, or two smaller losses in a row, for a total of 600 euros. Then I would enable it. I would do the same thing on the GBL_ON.

Those two systems alone should bring me to about 7k in one month.

In the meanwhile I also would enable the CL_ON_3 and a few other excellent systems, that, according to the investors' money management I could only enable if I had a capital of 30k, because almost all my good systems have a draw-down of about 10k.

But in my opinion, it's more effective to get out of trouble if you step on the gas than if you just enable one safe system and wait for it to take you out of trouble. By the time that small system will increase your account, it will have stopped working maybe, along with all the other good systems. On top of it, the safe systems are the ones that perform worse. Sometimes moving fast is safer than moving slowly, even when you drive.

However, one thing I cannot do, and that I would risk doing is discretionary trading. That has never produced anything good. Scaling up fast has produced very fast gains. Discretionary trading just produced losses after losses.
 
Last edited:
it's 14.07

It's 14.07 and I am kind of depressed.

I looked up an old web site that I used to check out frequently, as a discretionary trader. This is in fact a good source of ideas for automated strategies:
http://stockcharts.com/def/servlet/SC.scan

From that page, here's some concepts I could build systems on (I am only listing the LONG signals):

New 52-week Highs
Strong Volume Gainers
Bullish 50/200-day MA Crossovers
Oversold with an Improving RSI

There's a lot more ideas at that link but I can't understand them right now. And they don't seem easy to automate.
 
it's 14.44

It's 14.44 and I feel a little better.

I've had some emails back and forth with the investors and it looks like this time, too, the relationship has not aborted.

When you're dealing with long distance relationships, there's usually a high risk of breaking up. It's not like you're dealing with your cousin or something like that. All they need to do is block your email and you're history. That's why I am anxious.

My teeth are still itching, and maybe soon they will hurt. On the other hand, they... it's not just one or two but more like in five different places, so it might just be hypocondria:
http://en.wikipedia.org/wiki/Hypochondriasis

They can't all be sick. I've been brushing my teeth all the time since I went to the dentist, several years ago. But still, they can't all go bad in just 3 years of not going to the dentist.

Another 30 minutes and I will go home, to watch the Big Brother, who will take all my worries away.
 
Last edited:
In case anyone is wondering or worrying about me, I am taking a break from writing here. I am tired at the moment. I will definitely come back sooner or later. Feel free to write me questions or private messages.
 
giving support and resistance another chance (bouncing)

I have been thinking a bit, after stopping my compulsive posting here. By the way, I will post less in the future. I will try to keep it down to a few posts per month, all related to trading.

In these two weeks, I might have come up with a good idea that I should develop in the future, in terms of automating it: support and resistance, in terms of bouncing on it (not breakouts).

But it will be very hard to automate and for now I will just monitor it and briefly explain it here.

See attachment:
View attachment links.zip

You will find 13 links to futuresource.com charts of the 13 futures which my automated systems are trading:
6 currencies
2 stock indexes
2 bonds
gold, oil, natural gas

All the futuresource.com charts are set up on a daily timeframe.

I have placed in a separate folder the six futures that are approaching a support/resistance level.

My theory is that support and resistance on a daily basis do work. It's not a revolutionary idea, it's not new, and it's very simple, but if it works, it will be very good for me.

As I mentioned, it will be hard to automate it, but the idea in itself is very powerful for me, because I already know all the other edges (time of the day, and overbought/oversold conditions) and support and resistance was the last major edge i was missing.

For now I am referring to just horizontal support and resistance lines and not diagonal lines, but I am not ruling out to focus on those as well in the future (even harder to automate).

This is all I had to say (the rest will keep evolving in my mind), but I will quote a clear example of what I am referring to. Here's the daily AUD/USD chart:

AUD.png

You see, we have many things that tell us there will most likely be a powerful reversal:

1) the forex markets don't just keep rising forever, but zigzag much more and move in ranges
2) the dollar is highly oversold
3) the AUD is approaching resistance

If you add to this the time edge (what time of the day is it?) and the correlation with other currencies, you pretty much can forecast a reversal with great accuracy.

What I am missing is the fact that I have not backtested this, so not only is it impossible to automate, but I don't even know if what makes so much sense does actually work, in that I have neither traded it nor backtested it.

How would i go about backtesting and therefore coding this?

It will be my concern of the next few weeks.

What is resistance?

It is the High of let's say the last year, but that's not enough, because there could be a higher high one day before, which would totally invalidate it.

So it is ok to use a set period in the past (pointless to go back 30 years).

But in easylanguage (the first part of my job will be coding it on tradestation) we have to use the concept of "swing high":
...Swing High occurs when the PRICE of a bar is higher than the PRICE on the preceding bar(s), and at least as high as the same PRICE on the bar(s) that follow it...

That's right: this is because we want to make sure that it was the HIGH in terms of days following it, but also that it was the HIGH in terms of days preceding it. Then it could qualify as resistance.

Doing this by eye is very easy (but also there's a danger of making mistakes). Coding this is not easy at all. Automating is another problem (but easier since you've already defined it univocally when coding it for backtesting).

[...]

After some efforts, I am giving up on this, because it is just too much work to face right now. I will have to resume some other time and maybe some other way, too. However, I am pretty certain this is a valuable edge (support and resistance). It would be great to automate it because it takes a lot of patience to wait for S/R to be reached and it would be traded best as an automated system. But this can't be done unless I first test it, and I can't do this unless I first figure out how the SwingHigh function works.

Ok, I just found the right links, one for the function:
http://www.traderslaboratory.com/forums/f56/swinghigh-swinglow-easylanguage-functions-6284.html

and one for the indicator (I want to draw it to see what's going on):
http://www.elitetrader.com/vb/showthread.php?threadid=107989

This is still very hard. It reminds me of the systems on pivots (R1, S1, Pivot point), which I did manage to code but that did not prove profitable.

The problem is that the concept of SwingHigh as simple as it may be, in my little room, with all the work and worries, with all the noise around me, at the moment... defeats my brain. I cannot figure out how this simple code works and all its implications. I cannot focus enough to do it.

I am going to write to adamus to see if he can help out. I am stuck.

SwingHigh( Instance, Price, Strength, Length )

The indicator did not come out right.

I started working on the easylanguage code nonetheless and I am getting there, little by little, even though, without indicator, I am almost moving in the dark.

I fail to grasp the concept of that SwingHigh formula. There's just too many interruptions here in Rome: neighbours, relatives, sounds sounds sounds. I can't focus.

Here's what I came up with. Just doing in-sample for now, because I am far from coming up with the final formula.

Code:
Inputs: test(0), test2(0), test3(0);
Vars:  resistance(0), support(0);

resistance = SwingHigh(1,high,test2,test3);
support = SwingLow(1,low,test2,test3);


If marketposition = 0 and low < support Then Buy This Bar; 
If marketposition <> 0 and time >= 1600 Then ExitLong This Bar;

If marketposition = 0 and high > resistance Then sell This Bar; 
If marketposition <> 0 and time >= 1600 Then Exitshort This Bar;

At the moment I am running an optimization on the two variables of the SwingHigh and SwingLow formulas, even though I don't completely understand it (due to noise disrupting my thinking).

Through the optimizations I came up with nothing because I can't properly visualize what it's doing and I can't visualize it in my mind, because I am dead tired from work and bothered by all the noises around me.

However I might be developing a side formula for a new system.

Indeed the method still somehow works, but I might as well bet on a bounce off today's high and low... setting aside for the moment the other system.

Nope, nothing at all.

Nothing worked.

I will still have to go back and figure out the swinghigh and swinglow functions, sooner or later, and find a way to code support and resistance.

I am quite sure that they work, so I really need to find a way to backtest them to know exactly how to trade them.

Here's a snapshot of the current problems I am having with the easylanguage SwingHigh formula:

Snap1.jpg

This thread shows the complexity of what I am trying to achieve:
http://www.trade2win.com/boards/mechanical-systems-trading/85466-easylanguage-question.html

This is too complex for my capabilities.

For example, even tradestation makes available this signal, "TrendLines Automatic Long Entries". But it has too many variables and I get lost into that code. Let alone automating the whole thing after I am done backtesting.

Let's go back to basics and resume from there. Let's forget SwingHigh for the moment.

Here's, once again, the daily AUD/USD chart:

AUD.png

What do I want to know? I want to go short if we get near the high of the whole chart, which means the high of the last year. I don't care what happens before.

This is going to be achieved with this (simpler) function:
High>Highest(High,200)[1]

The system would look something like this:
If marketposition = 0 and High>Highest(High,100)[1] Then sell This Bar;
If marketposition <> 0 and time >= 1600 Then Exitshort This Bar;

Now this is much clearer.

But there's a problem. That value is only good if it's lasted for a while, so once again we need the SwingHigh function, because it verifies that the High has lasted for a while. Except we want that High to be the highest one and I still don't know how to do it.

Now, what would happen if I added the SwingHigh function to the Highest function?

If marketposition = 0 and High>Highest(High,1000)[1] and High>swinghigh(1,High,200,1000) Then sell This Bar;
If marketposition <> 0 and time >= 1600 Then Exitshort This Bar;

Nothing changes. What is worse is that I still don't fully comprehend what I am doing with that function.

So back to basics again and I will use "highestbar" which is the number of bars ago the highest value was recorded.

If marketposition = 0 and High>Highest(High,1000)[1] and HighestBar(High,1000)[1] > 200 Then sell This Bar;
If marketposition <> 0 and time >= 1600 Then Exitshort This Bar;

This makes sure that the highest high lasted at least for 200 bars (two days because I am using 15 minute bars right now).

Ok, I am getting there.

This code triggers a trade if price ever goes higher than the highest peak of the last year, and if that peak has lasted at least 10 days (every 100 bars is about one day):

If marketposition = 0 and High>Highest(High,20000)[1] and HighestBar(High,20000)[1] > 1000 Then sell This Bar;
If marketposition <> 0 and time >= 1600 Then Exitshort This Bar;

Except that it makes no money.

Instead I found this system which almost always makes money, and even though it is a bit far from what I wanted to achieve, I might come up with something good ultimately from all this reasoning:

If marketposition = 0 and High>Highest(High,2000)[1] and HighestBar(High,2000)[1] > 100 and time > 1100 Then sell This Bar;
If marketposition <> 0 and time >= 1600 Then Exitshort This Bar;

If marketposition = 0 and low<lowest(low,2000)[1] and lowestBar(low,2000)[1] > 100 and time > 1100 Then buy This Bar;
If marketposition <> 0 and time >= 1600 Then Exitlong This Bar;

How's a profit factor of 20? Good enough?

This system basically goes long/short when, after 5 PM CET, this month's low/high is surpassed.

This is even better and closer to what I had in mind:

If marketposition = 0 and low<lowest(low,2000)[1] and lowestBar(low,2000)[1] > 100 and time > 1100 Then begin
buy This Bar;
entry_date = datetojulian(date);
end;
If marketposition <> 0 and datetojulian(date) >= entry_date + 15 Then Exitlong This Bar;


If marketposition = 0 and High>Highest(High,2000)[1] and HighestBar(High,2000)[1] > 100 and time > 1100 Then begin
sell This Bar;
entry_date = datetojulian(date);
end;
If marketposition <> 0 and datetojulian(date) >= entry_date + 15 Then Exitshort This Bar;


Very few trades but a profit factor of almost 6. And I know how to automate it.

I will stop posting this code from here on, for secrecy purposes. I'm getting too far in my creation. From here on I will keep it to myself.
 
Last edited:
Re: giving support and resistance another chance (bouncing)

I'll try to help you with the SwingHigh and SwingLow functions, as requested. I'm not sure that what I can explain here will help because it's the usual story: you don't understand it and I'm not sure I can explain because I don't understand why you don't understand!

I can try to explain the whole thing, but this will probably seem to you just like the explanation given in the TradersLab link.

The first problem you mentioned was confusion over the 2nd parameter - Length. This limits the amount of processing that needs to be done, and because it limits the number of bars to look back at, it can cause the function to return before it discovered the Swing bar. That is why the function states it returns -1 when the bar is not found.

It is necessary because the function does a lot of processing for each bar, directly proportional to the value of the strength parameter. So if you set both parameters high, as you did here:

travis said:
Code:
If marketposition = 0 and High>Highest(High,1000)[1] and High>swinghigh(1,High,200,1000) Then sell This Bar; 
If marketposition <> 0 and time >= 1600 Then Exitshort This Bar;

then the algorithm is forced to check all 200 bars before and 200 bars after each bar to see if it was the Swing bar.

I think you need to determine the best value for Length by considering how frequently the market is making new highs. If it's making new highs every 25 bars, then that is the order of magnitude that you should use, and the minimum value that would give the function the chance of returning the value you visualize from the chart.

Actually perhaps you should increase the order of magnitude by 1 to be sure that you will pick up the Swing bar that you visualize when looking at the chart, e.g. if the new highs appear on average every 25 bars, make the Length parameter 250.

This is because there is a small chance that the market has just gone into a very protracted and orderly downtrend with no decent SwingHigh for the last x bars.

So I think that is the best way to estimate a good setting for Length. But look at it another way: the optimal setting would really be infinity, so that you are absolutely bound to discover the last Swing. However practical considerations of CPU power and time available require us to reduce Length to something that we can work with on our desktop PCs or laptops.

To look at it from another perspective, understanding the Strength parameter will probably reduce confusion over the Length parameter. To determine the best value for the Strength parameter so that you can plot S&R on your chart according to the visualization you have in your mind, just pick the weakest looking SwingHigh and count the number of bars that it had before it and after it. The maximum of before and after is a good guess at the value for Strength.

Did you realise that the higher you set Strength, the fewer Swings you will identify?

I don't know how the Tradestation function works, it might be the opposite of the Swing function that I wrote, but I assume that any sane programmer would have written it to search backwards from today over the bars to identify the last Swing.

That means the algorithm is quite simple. The first thing it does is to examine the bar[Strength] (the bar that is Strength bars back), assuming it is allowed to by the settings of Length and MaxBarsBack.

Then it checks the bars after it. Were they all equal or lower? If yes, then it checks Strength number of bars before it. Were they all lower too? Yes? That is the Swing bar. No? Then move back one bar and repeat.

OK. That's as much as I can think of to explain it now. Did any of it help?
 
Thanks for the detailed help, even though as I wrote in my private message and in my previous post I have now abandoned the SwingHigh function in favor of Highest function and will keep it that way, because even after your explanation, SwingHigh has too many variables and implications that would make my work too complex (in particular my automation of the back-tested system).

If you have questions about what this new system does, let me know via private messages, because I have gone too far to give away my code here.

I am sorry for causing this misunderstanding and for making you do work that I no longer needed. At the moment I do not need any help, but I am willing to show you my idea in detail in return for having bothered you. And showing you my system will also help me clarify my ideas.
 
Thanks for the detailed help, even though as I wrote in my private message and in my previous post I have now abandoned the SwingHigh function in favor of Highest function and will keep it that way, because even after your explanation, SwingHigh has too many variables and implications that would make my work too complex (in particular my automation of the back-tested system).

If you have questions about what this new system does, let me know via private messages, because I have gone too far to give away my code here.

I am sorry for causing this misunderstanding and for making you do work that I no longer needed. At the moment I do not need any help, but I am willing to show you my idea in detail in return for having bothered you. And showing you my system will also help me clarify my ideas.

No problem.

It actually allowed me to practice my communication skills which I think after my recent stupid dialog with meanreversion on my journal really need some improvement.

Plus It was actually informative for me just to think about the function again, because I have my own SwingHigh function in NinjaTrader, and I don't just use a "Strength" parameter, I have 'before' and 'after' Strength parameters. But I think they are justified.

And I noticed that my functions are really intensive on CPU cycles if I use large parameter values, so I might actually program in a Length parameter to my own functions if necessary.

Good luck with the system. Hope it works.
 
glorious victory over vito: he was moved out

After almost 7 months of having him in my room, Vito the Chimp today was unexpectedly (by me) moved to another room (50 meters away from our room). I almost can't believe it. This is a major improvement in my life.

The movers came and said "are you ready for us to move your stuff?". And then in 15 minutes he was gone, with all his stuff, without any warning. In 15 minutes the seven month long torture came to an end.

I did not pretend to mourn his departure. I just told him, coherently, that if he needed help with excel he could still call me. Yeah, because he got sentimental and said that he didn't want to lose his friends (me and my other colleague, who survived the chimp).

I did not rejoice publicly at the office. I came home and started calling those few people I had complained to for the past seven months, saying "it's done!".

I will now look on youtube for at least one song to commemorate this event.


Right, a love song dedicated to myself for having put up with this ordeal for so long without getting mad and ultimately coming out on top. Oh yes, I am such a great human being. I am really something.

And on these two journals of mine, here, you have witnessed me survive two evil colleagues: Vito the Chimp and, long before him, at the beginning of the first journal, the Idiot with the Radio (who played his radio all day long).


http://fr.wikipedia.org/wiki/Lilly_Wood_and_the_Prick
http://www.idylle-guerlain.com/guerlain-idylle.html#/fr/fr/homePage/

I spent my life
Thinking about you and I
And I, I want to spend my time
In your arms
But time has no meaning
If you’re not around
All I have to give is for you
… close

[Refrain]
This Is a Love Song, a love song…

I’m trying to call with my images of you in heart
Like in each other behind my back my back

[Refrain]

This is your love song, your love song baby…


It reminds me of Creep by Radiohead and another song which I can't recall. But it doesn't matter. It's original, it's good, I like it.
 
Last edited:
weekend update

In case anyone is curious I am going to sum up the latest news from my systems.

Here's the situation as far as their real-money non-tampered trading (basically my "track record", straight from the investors' account).

Snap1.jpg

Yeah. It has never looked better than now. I am going to dedicate "this is your love song" to my track record.

http://www.youtube.com/watch?v=zRYdyyQSFdU


And now let's get to my paper-traded systems (71 systems now). Only 38 out of 71 of them have been profitable so far:

HTML:
CL_ON_2	12,956
CL_ON_3	10,612
GBL_ID	9,162
GBL_ON	8,883
GC_ON	8,302
ES_ON_2	5,340
ZN_ON_2	5,195
GBP_ID_2	4,278
GBP_ID_5	4,081
CL_ID_2	3,982
YM_ON	3,965
GC_ID	3,579
EUR_ID_5	3,488
JPY_ON	3,222
YM_ON_2	3,205
NG_ID_2	3,197
GBP_ID_3	2,306
CL_ID_3	2,227
GBP_ID_7	2,040
CL_ID_4	1,910
GBP_ID_4	1,778
GBL_ID_2	1,302
CAD_ID	1,223
EUR_ON	765
GC_ID_3	663
CAD_ID_2	336
ES_ON	232
CAD_ID_3	174
NG_ON_2	162
CHF_ID_2	154
EUR_ID_2	117
GBP_ID_6	114
ZN_ID	96
ZN_ID_3	68
CL_ON	60
NG_ID	57
ES_ID_5	34
ZN_ID_4	23
NG_ON	-6
NG_ID_3	-21
ES_ID_3	-41
AUD_ID	-267
CHF_ID	-354
CHF_ID_3	-357
EUR_ID_4	-364
AUD_ID_2	-403
YM_ID_4	-431
JPY_ID	-431
YM_ID_2	-435
YM_ID_3	-476
JPY_ID_4	-480
ZN_ON	-694
JPY_ID_3	-799
AUD_ID_3	-819
ES_ID_4	-1,095
EUR_ID_7	-1,186
GBP_ON	-1,268
YM_ID	-1,398
GC_ID_2	-1,554
ES_ID	-2,010
EUR_ID_9	-2,764
ZN_ID_2	-3,274
ES_ID_2	-3,383
CL_ON_4	-3,916
NG_ON_3	-4,474
EUR_ID_8	-4,933
JPY_ID_2	-6,370
GC_ON_2	-6,785
EUR_ID_6	-8,302
EUR_ID_3	-14,140
CL_ID	-25,710
Total	10,349

38 systems are profitable, but the ones that are worth trading are just 18 (of which only 7.25 are being traded with real money on the investors' account): the ones identified by this scatter plot that my dad helped me devise (he knows nothing about trading, but a lot about statistics). There's two things being measured: horizontally I am measuring the number of trades made in forward testing (which means my paper trading of the systems), and vertically I am measuring the Sharpe Ratio.

This scatter plot basically can't fail and says it all:

Snap2.jpg

The Sharpe Ratio speaks for itself. The other important factor is the number of trades, because I cannot judge a system by one trade. Given the fact that I back-tested the new ones using the out-of-sample verification, I am willing to trust systems that have as few as 8 trades, especially if they have great Sharpe Ratio values. A better Sharpe Ratio makes me willing to overlook the number of trades to a minimum of 8. This is only because all the out-of-samples for my new systems have done well.

For the other systems, the older ones, this is not the case: until June 2010 I never used the out-of-sample when creating my systems, and a larger percentage of them turned out to be unprofitable in the long run. For the older systems we could say that the out-of-sample was replaced by the forward-testing - and incidentally it was a mistake because that way I wasted years, before finding out if a system worked. But now it's not a problem because the older systems already have dozens of forward-tested paper trades, and I know which are good and which are not. Systems are not appearing on the scatter plot, if their Sharpe Ratio is lower than 1.5, which I consider the minimum requirement.

I am going to dedicate another love song, this time to the scatter plot.

 
Last edited:
getting back to my support and resistance system

I am having some free time, have slept well, and want to dedicate a few hours to the system I was talking about here:
http://www.trade2win.com/boards/trading-journals/85510-my-journal-2-a-206.html#post1414356

I have already created a profitable system and now I need to disclose it, because I need to bring to yet another level - if I succeed I will not disclose the final version. But this is not good enough to be hidden.

I am not going to repeat what I explained already at the link above (very long post, so good luck reading it).

The situation right now is this.

If Low<Lowest(Low,2000)[1] and LowestBar(Low,2000)[1] > 200 and Lowest(Low,2000)[1] <= Lowest(Low,2200)[1] and time > 1100 and time < 1500 Then buy This Bar;
If time >= 1600 Then Exitlong This Bar;

If High>Highest(High,2000)[1] and HighestBar(High,2000)[1] > distance and Highest(High,2000)[1] >= Highest(High,2200)[1] and time > 1100 and time < 1500 Then sell This Bar;
If marketposition <> 0 and time >= 1600 Then Exitshort This Bar;

Here's what the long strategy does (short is viceversa):
On a 15 minute timeframe,
1) if the Low of the last candle is lower than the lowest price of the month
2) if the lowest price of the month took place over two days ago
3) if the lowest price of the month

wait... I am going to change the code and try to use swinglow and swinghigh again. Now, after weeks of thinking about them, I understand them better.

Nope. I still do not understand them. For one thing, I don't understand why it takes tradestation half an hour to complete the calculation of profit if i use swinghigh and swinglow.

Ok, I changed the code to:

Inputs: test(0), test2(0), test3(0);
vars: HH_LL_bars(0),pre_HH_LL_bars(0),post_HH_LL_bars(0);
HH_LL_bars = test;
pre_HH_LL_bars = test2;
post_HH_LL_bars = test3;


If marketposition = 0 and low<lowest(low,HH_LL_bars)[1] and lowestBar(low,2000)[1] > post_HH_LL_bars
and lowest(low,HH_LL_bars)[1] <= lowest(low,HH_LL_bars + pre_HH_LL_bars)[1]
and time > 1100 and time < 1500 Then buy This Bar;
If marketposition <> 0 and time >= 1600 Then Exitlong This Bar;

If marketposition = 0 and High>Highest(High,HH_LL_bars)[1] and HighestBar(High,2000)[1] > post_HH_LL_bars
and highest(high,HH_LL_bars)[1] >= highest(high,HH_LL_bars + pre_HH_LL_bars)[1]
and time > 1100 and time < 1500 Then sell This Bar;
If marketposition <> 0 and time >= 1600 Then Exitshort This Bar;


I am now running an optimization for 500 to 2000 for all three inputs, in steps of 500 bars.

Here's what I am doing.

I am making sure that (I am talking of the long strategy, the short one is the opposite) my trade gets triggered once price goes lower than the lowest low of the last x periods ("HH_LL_bars"). But here's the catch. That lowest low also has to have lasted at least y periods since happening ("post_HH_LL_bars") and that same lowest low has to have been in place for at least z periods ("pre_HH_LL_bars").

By optimizing, I am trying to establish how long those x, y, z periods have to be.

I am going to draw this, while I run the optimization:

drawing.jpg

Now, by looking at the drawing, one could wonder, as I did, why don't you just use the lowest low of the 3 periods put together? The answer is tricky and simple, but tricky nonetheless, but simple nonetheless, depending if you're retarded like me.

First of all, using the lowest low of the last month means that the post period gets included, or rather overlaps with the other, bigger, period. The "post" period is included within the "during" period, but they have to be computed separately.

If I took the lowest low of the 3 periods put together, I would not have the guarantee that it has lasted Y bars before triggering the trades, nor that it lasted Z bars BEFORE the period for which it happened. For the Y part is clear why I have to divide the periods in two. For the Z part, let me explain it more (first of all to myself). If, instead of saying "lowest low of month 2, provided that it was also the lowest low of month 1", I just said "lowest low of month 1 and 2", what would happen is that we would not have a guarantee that the lowest low had lasted for at least a month BEFORE it happened, because it could have as well happened during the month 1. And if I don't have a guarantee of it being preceded by a buffer month, then it is less valid as a support level.

This could all be achieved by the swinghigh and swinglow formulas, but since they're complex and since i suck at formulas and since tradestation when using them takes ages to run, I had to develop my own simple, clear, effective, fast formula (which is the one I just finished explaining).

Now, as i said, this strategy works but it trades very rarely and I feel i can't even automate a system that trades twice a year, even if it wins almost every time and even if it trades many markets. The minimum trades I've had so far for a system is six trades per year, and I cannot go below that. Besides, I sense that this system should be taken much much further. It's just that I am a handicapped self-taught programmer. That's the problem.

Ok, dude, the optimization has run.

It seems that my system wants a lower "post" value than the other two.

Now I am working harder on the other two values: pre_HHLL, and during HHLL.

Another advantage of my formula vs the swinghigh and swinglow formulas is that the pre and post periods don't have to be the same. In fact my brain is smoking by how hard this puzzles me.

How long does a low have to be in place to be important? My brain is smoking. I wish they hadn't made me study ancient Greek and Math instead. This is the consequence. A bunch of braindead teachers killing other people's brains. Ancient Greek is useless for my life. Damn, damn, damn.

So, let's start all over again.

We want the low to have lasted for a while and we take the lowest value of the month, but then we also want this lowest value of this month, to be lower than any value of the previous month.

And so far so good.

Now my only problem remains in how much time this lowest value of this month must have lasted for me to make as much money as possible with my trades.

I am going to test it now.

The problem still seems to be that on the EUR this system produces yes 100% of winners but just 6 trades in 4 years.

I need to test it elsewhere and optimize these 3 values to see what happens.

So far both "pre" and "during" seem to settle for a value of 1500.

But all these optimizations are useless when all you have is six trades being triggered. It could all be a matter of chance. I'm gonna have to move on the GBP.

The optimization finished on the "post" period as well. It seems to settle on a value of 100. Now this puzzles me. Why is it that we need this value to be the lowest low of the month, it has to be lower than any value of the previous month, but then it does not matter if it has happened just yesterday?

Anyway, here's the bestest code for the EUR:

Inputs: test(0), test2(0), test3(0);
vars: HH_LL_bars(0),pre_HH_LL_bars(0),post_HH_LL_bars(0);
HH_LL_bars = 1000;
pre_HH_LL_bars = 1000;
post_HH_LL_bars = 100;


If marketposition = 0 and low<=lowest(low,HH_LL_bars)[1] and lowestBar(low,2000)[1] > post_HH_LL_bars
and lowest(low,HH_LL_bars)[1] <= lowest(low,HH_LL_bars + pre_HH_LL_bars)[1]
and time > 1100 and time < 1500 Then buy This Bar;
If marketposition <> 0 and time >= 1600 Then Exitlong This Bar;

If marketposition = 0 and High>=Highest(High,HH_LL_bars)[1] and HighestBar(High,2000)[1] > post_HH_LL_bars
and highest(high,HH_LL_bars)[1] >= highest(high,HH_LL_bars + pre_HH_LL_bars)[1]
and time > 1100 and time < 1500 Then sell This Bar;
If marketposition <> 0 and time >= 1600 Then Exitshort This Bar;


11 trades in about 3 years. Pretty good this time. Profit of 2000 dollars. Almost acceptable but still not good enough.

So basically the optimization reaches optimum values with 100 or more 15 minute periods (more than one day) after the lowest low has happened.

The lowest low is measured within the last 2 weeks. And it has to have been in place also for the previous 2 weeks.

This is pretty good. Also I changed the fact that it doesn't have to be lower but it can be the same (very rare anyway).

Damn. Now it doesn't work on GBP though.

If I set the 3 values to double the optimal ones for EUR, to 200, 2000, 2000, then it works on both, so that is how I'll keep it. GBP this way makes 10 trades, and 300 ticks of profit in the usual 3 years.

Now I am testing CAD. Decent success on CAD as well with 200 2000 2000.

Yet so far these work best on all EUR, GBP, CAD:

HH_LL_bars = 2000;
pre_HH_LL_bars = 1000;
post_HH_LL_bars = 200;

On average they make 3 trades per year, still low. But if all six currencies traded like this, that would mean 18 trades per year with a high success rate.

CHF breaks even. Now JPY.

Holy cow! Works on JPY as well, where usually nothing works.

Now AUD. Forget it, as it has totally different times. There's no way to figure this one out, ever.

Now let's try the other futures.

CL, it works too, both long and short. As usual, just 4 trades per year. And now we're at 6 futures, making 4 trades per year, which makes a total of 24 trades per year, almost all winners.

On GC it only works long but that is because gold has done nothing but go up in the last 10 years.

Ok, as expected, I am going to have to stop here, because this is starting to work really well actually. I can't just keep on posting all my work, because I'd be losing my edge (if everyone uses it, that's what happens).

To conclude this public work, I will say that support and resistance can definitely be exploited much more brilliantly than with this system, but if a system has an edge it's good enough to be traded. This system, with about 2 trades per month (with a large majority of winners), is definitely worth trading.
 
Last edited:
Re: getting back to my support and resistance system

I think Tradestation is taking a long time to process the system with SwingHigh and SwingLow because you are using very large values for the "Strength" parameter, e.g. 2000.

I think SwingHigh and SwingLow were written to display the SwingHigh and SwingLow on an average chart for a technical analysis trader who probably has max 100 bars on the screen, i.e. the Strength value the person who programmed it was thinking of was probably a range from 1 to 10. It probably gets exponentially slower the higher you make that parameter.

Anyway, it's interesting you wrote your own version to get around the problem - and you ended up also coding it to allow different Strength values for before and after the Swing. My indicator though is also slow with large parameter values - I got around the problem by using a longer time frame. I was on 1 hour bars, and I added the indicator using daily bars which made it much quicker. I couldn't understand quite you meant when you explained your algorithm for it though. So I guess your edge is safe!
 
Status
Not open for further replies.
Top