Currency strength (like Hanover)

Place your new trading idea here to see if someone can automate it.
Locked
User avatar
squalou
Trader
Posts: 49
Joined: Wed Nov 16, 2011 8:57 am
Location: fabulous Aix en Provence, southern France;

Re: Currency strength (like Hanover)

Post by squalou »

garyfritz wrote:(...)

Help? Anybody with indicator experience, can you offer me some advice?

This is such a BLOODY STUPID IDIOTIC model!!! This is WHY there is such a problem with repainting indicators -- because the stupid damn thing keeps recalculating the last few bars, changing its mind retroactively. I've coded indicators on half a dozen different trading platforms and I've never seen anything like this -- nothing this complicated, nothing this confusing, and nothing that produces erroneous repainting indicators. Stupid %@#!$! braindead @%^@$%! CRAP!!T4!! :evil: :evil: :evil:
Hi there....

I know exactly how you feel, Gary...

Coding indicators is a very special activity, requiring a very special mindset, indeed :mrgreen: .

You found your answer by yourself, and sometimes this is the best thing that can happen to you !

You MUST recalculate the EMA for each bar.

Empty4 designers had their moment of lucidity ( :? ) when they decided to provide the iMAOnArray() function...
However, don't think it is now a piece of cake... naaaa.... too easy... :mrgreen:
Because then their tortured minds came up with the ArraySetAsSeries() function...
and you'll start pulling your hair again, believe me.... :shock:

Fortunately enough, if you are playing with "buffers" as the input data, then you can use iMAOnArray() directly on the "buffers" at no extra brain cost...
I let you play a bit with that function...


However, that issue will be irrelevant when it comes to invoking the indicator from an EA, because iCustom() calls will reload and recalculate the indicator buffers every time, so it will give correct output buffer values at each call.


BTW, nice and clean work on the indicator code!


Sq
" Every battle is won before it is ever fought "
Sun-Tzu, The Art of War, 400BC.
rebeljedi
Trader
Posts: 87
Joined: Mon Nov 21, 2011 4:17 am

Re: Currency strength (like Hanover)

Post by rebeljedi »

Mediator wrote:Hi gary,

live could be so easy, take the CCFp Indicator.
I recommend it some time in an EA board from steve to exchange the hanover module with this indicator but don't know where.

it provides you the same information and works on every TF you like Daily and higher too.

Attached is a modified version with many setting.

Cheers

Mediator
hi garyfritz,

besides the CCFp that Mediator mentioned, there is Complex Common indicator which also looks at currency strength.
CCFp is a trend indicator whereas CC is a signal indicator for H4 timeframe.
http://www.stevehopwoodforex.com/phpBB3 ... =450#p9716
http://articles.mql4.com/484
garyfritz

Re: Currency strength (like Hanover)

Post by garyfritz »

Thanks Mediator, I will see if I can learn anything from the CCFp code.
tgarcia291 wrote:Oh, and if Metrader 4 is such crap, why do continue to use it?
Because of communities like this one. Steve and others are incredibly generous in sharing their ideas and their work. I grit my teeth and tolerate the steaming stinking pile of excrement that is Empty4 only because it lets me tap into this great source of inspiration and ideas. And I use Tradestation and other platforms for my "real" work. I don't trust Empty4 any further than I can throw it. It is badly-designed garbage.

Thanks sq, I'll take a look at those suggestions!
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Currency strength (like Hanover)

Post by SteveHopwood »

garyfritz wrote:I grit my teeth and tolerate the steaming stinking pile of excrement that is Empty4 only because it lets me tap into this great source of inspiration and ideas. And I use Tradestation and other platforms for my "real" work. I don't trust Empty4 any further than I can throw it. It is badly-designed garbage.
Now come on Gary. Stop beating around the bush, and say what you actually think. :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. [email protected] 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: Currency strength (like Hanover)

Post by garyfritz »

Oh trust me, that WAS beating about the bush. What I actually think would have made one of your profanity-laced rants look like a Sunday school lesson. :lol:
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Currency strength (like Hanover)

Post by SteveHopwood »

garyfritz wrote:Oh trust me, that WAS beating about the bush. What I actually think would have made one of your profanity-laced rants look like a Sunday school lesson. :lol:
Booking my ringside seat. Two adults and a misc number of children depending on whichever of my pupils happen to be around and want to see some blood shed - that is all of them. Irreverent bunch, my lot. :lol:

Seriously, you now understand why few of us attempt to tackle both indi and ea coding. My imagination boggles at what you are trying to do.

: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. [email protected] 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.
Fx93
Trader
Posts: 83
Joined: Mon Apr 09, 2012 6:32 pm

Re: Currency strength (like Hanover)

Post by Fx93 »

I just thought I'd mention that it is really easy to creatively build indicators on the thinkorswim platform. For example, I just overlaid the Standard Deviation and Standard Error indicators then plotted the difference between them, and it took like 5 minutes. So if you want to be creative fast, it's real nice. Of course, it won't help if you want to use the said indicator in an EA.
garyfritz

Re: Currency strength (like Hanover)

Post by garyfritz »

squalou wrote:Empty4 designers had their moment of lucidity ( :? ) when they decided to provide the iMAOnArray() function...
However, don't think it is now a piece of cake... naaaa.... too easy... :mrgreen:
Because then their tortured minds came up with the ArraySetAsSeries() function...
and you'll start pulling your hair again, believe me.... :shock:
Oh... my... f***ing... GAWD.

That's it. Now I'm certain. These guys are agents of the Devil, if not Lucifer incarnate himself.

That's just hideous. Heinous. Any self-respecting programmer would hang these demonspawn by their dangly bits and use them for target practice. Then burn and bury their remains and salt the earth over it.

I didn't think it was possible, but my opinion of Empty4's design just got even WORSE. Gawd, aaack ptui and BARF!

*sigh*

So, sq...

Let's say I calculate values in array[] as I work through the bars. If I use ArraySetAsSeries(), the array gets indexed in the same order as buffers. So array[0] is the last (rightmost) element, corresponding to bar 0. Normally the order wouldn't really matter, unless you use something like iMAOnArray(). So after doing ArraySetAsSeries(array, true), if I use iMAOnArray() to do a 3-bar SMA ending at array[1], the MA will include the values from array[3], array[2], and array[1]... right?

What if start() only gets called on bars 0 and 1, as it often does. array[3] and array[2] never got calculated!? How can iMAOnArray() calculate an SMA on them? Is it necessary to process the bars from oldest down to bar 0? (That seems to work a lot better!)

It's slow going but I'm making progress. I think I'm close but it's not quite there yet.

Merci beaucoup pour votre aide, sq!!
User avatar
squalou
Trader
Posts: 49
Joined: Wed Nov 16, 2011 8:57 am
Location: fabulous Aix en Provence, southern France;

Re: Currency strength (like Hanover)

Post by squalou »

garyfritz wrote:
squalou wrote:
So, sq...

Let's say I calculate values in array[] as I work through the bars. If I use ArraySetAsSeries(), the array gets indexed in the same order as buffers. So array[0] is the last (rightmost) element, corresponding to bar 0. Normally the order wouldn't really matter, unless you use something like iMAOnArray(). So after doing ArraySetAsSeries(array, true), if I use iMAOnArray() to do a 3-bar SMA ending at array[1], the MA will include the values from array[3], array[2], and array[1]... right?

What if start() only gets called on bars 0 and 1, as it often does. array[3] and array[2] never got calculated!? How can iMAOnArray() calculate an SMA on them? Is it necessary to process the bars from oldest down to bar 0? (That seems to work a lot better!)

It's slow going but I'm making progress. I think I'm close but it's not quite there yet.

Merci beaucoup pour votre aide, sq!!
OK, now I am pulling my hair ! :lol:

Order of elements doesn't matter if you stikc to SMA, which is symetrical.
But if you want to calculate an EMA, then order does matter, because EMA is recursive: the newt element depends on the previous one, so you'd better be walking in the correct direction.

What is really misleading in MQL explanations is that they use words like "from right to left", which really means nothing :
where is element [0] in an array ?
on the left, like any western person ever learned at school ?
or is it on the right, like Empty4 "buffers" seem to be suggesting ?...

When they say "from right to left", does this mean
-1- in decreasing indexes (as you would expect on normal arrays that you would write down on a paper) ?
or
-2- is it increasing indexes if you consider that buffer[0] is the most recent value in the array, and you would write down on paper the buffer elements by starting with the oldest element on the left of the page, and finish with the most recent element (=buffer[0]) on the right of the page ???

:lol: :lol: :lol:

The answer is : -1- : you always write the array or buffer on paper starting from index [0] on the left, then increasing indexes as you are moving to the right.
Now, "buffers" (="series") will be evaluated "from right to left", meaning starting with the highest index first and going down, whereas "regular arrays" (non-"series") will be evaluated in increasing indexes, i.e from left to right.
Does this seem more clear now ? :lol:

A good example is worth a thousand words...
Have a look at the default Empty4 Stochastic indicator code, it has the SMA on buffers part.
Very straight forward.

Code: Select all

//---- Signal line is an SMA of %D
   for(i=0; i<limit; i++)
      SignalBuffer[i]=iMAOnArray(MainBuffer,Bars,DPeriod,0,MODE_SMA,i);
"MainBuffer" is a ... buffer.


In you indicator, the first round of EMA smoothing is performed on buffers (the copied series of close prices), so you can use iMAOnArray() directly on those, using the same index value as the indicator output buffers.


SQ
" Every battle is won before it is ever fought "
Sun-Tzu, The Art of War, 400BC.
User avatar
nanningbob
Trader
Posts: 4560
Joined: Sun Dec 04, 2011 1:23 pm

Re: Currency strength (like Hanover)

Post by nanningbob »

HUH??? After reading this thread I have a question, Does it work now??? Duh ............... :? picking nose sitting in corner with dunce hat.
I trade http://www.stevehopwoodforex.com/phpBB3 ... =38&t=3964,
I talk about my philosophy of trading here.
http://www.stevehopwoodforex.com/phpBB3 ... =38&t=3627
"The key to converting something useful to others is simplicity. Complexity is the enemy to execution." Tony Robbins
Locked

Return to “Ideas for Possible Automation”