stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Cross Slopey Bob
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3917
Page 5 of 7
Author:  Pedigree [ Sun Nov 16, 2014 8:00 am ]
Post subject:  Cross Slopey Bob

SteveHopwood » Sun Nov 16, 2014 1:38 am wrote: I am doing the best i can here with something I do not actually understand.
And it is greatly appreciated, not just for this but for several other projects.

SteveHopwood wrote: You think you can do better, then go right ahead and try.
You are doing a great job and must remain firmly in the driving seat! Yesterday was my first time reading this thread. I have no idea what the project is all about. My response was just to the last few posts I happened to view. If the suggestion is of no relevance it should simply be regarded as a distraction and ignored.
Author:  pips400 [ Sun Nov 16, 2014 9:15 am ]
Post subject:  Cross Slopey Bob

FWIW, if considering the slope as well as the difference in the currencies then a further calculation would be needed. I still think the simple expression MathAbs (Cur1 - Cur2) will provide the solution to the first part, the beauty of MathAbs is that it doesn't matter which number is subtracted from which because it will always return a positive number, thus eliminating the need for any other code to determine which value is higher than the other.

The second part of determining slope is more complex and there's probably a few ways to do it, but what comes to mind would be using
1. an array to store the currency strength values (if not alredy), then
2. using something like
if ( Currency1slope[1] - Currency1slope[2] > Currency2slope[1] - Currency2slope[2] ) to compare values
of course further variables and code could be added to give other information depending upon what was trying to be achieved. But the basic idea is using an array to hold historical values then calculations can be made accordingly.

e.g.

Code: Select all

bool extrabuysignal () {
if (MathAbs (Currency1slope[1] - Currency2slope[1]) >= 0.6 && ( Currency1slope[1] - Currency1slope[2] > Currency2slope[1] - Currency2slope[2]  ) )
return true;
else return false;

}
Again apologies if not helpful

Pips400
Author:  SteveHopwood [ Sun Nov 16, 2014 9:22 am ]
Post subject:  Cross Slopey Bob

pips400 » Sun Nov 16, 2014 9:15 am wrote:FWIW, if considering the slope as well as the difference in the currencies then a further calculation would be needed. I still think the simple expression MathAbs (Cur1 - Cur2) will provide the solution to the first part, the beauty of MathAbs is that it doesn't matter which number is subtracted from which because it will always return a positive number, thus eliminating the need for any other code to determine which value is higher than the other.

The second part of determining slope is more complex and there's probably a few ways to do it, but what comes to mind would be using
1. an array to store the currency strength values (if not alredy), then
2. using something like
if ( Currency1slope[1] - Currency1slope[2] > Currency2slope[1] - Currency2slope[2] ) to compare values
of course further variables and code could be added to give other information depending upon what was trying to be achieved. But the basic idea is using an array to hold historical values then calculations can be made accordingly.

e.g.

Code: Select all

bool extrabuysignal () {
if (MathAbs (Currency1slope[1] - Currency2slope[1]) >= 0.6 && ( Currency1slope[1] - Currency1slope[2] > Currency2slope[1] - Currency2slope[2]  ) )
return true;
else return false;

}
Again apologies if not helpful

Pips400
Most helpful. Thanks very much. :clap:

:xm:
Author:  SteveHopwood [ Sun Nov 16, 2014 9:37 am ]
Post subject:  Cross Slopey Bob

Even more useful than I thought. I had to look at the code again and spotted an error in looking back in time to spot the cross.

:xm:
Author:  SteveHopwood [ Sun Nov 16, 2014 7:20 pm ]
Post subject:  Cross Slopey Bob

V 1g is in post 1.

I realised what was needed as soon as I thought about it with a clear head. The difference at close(1) needs to be > our chosen minimum, and needs to be > than that of close(2), otherwise the lines might be converging again.

Get an eyeful of this little lot guys:
XAGUSDH1.png
There were a lot of small losers - that is what the latest version is trying to cut out. The pips came from closing the entire position 3 times to ensure a shed-load of profits did not disappear. The final one was on Friday so the EA could be flat for the weekend. The profit represents c. 16% of the account balance on trading for the week. Phenominal.

:xm:
Author:  alfarunner [ Mon Nov 17, 2014 9:17 am ]
Post subject:  Cross Slopey Bob

Why do I get these messages with version 1g?
http://www.staffanmalmberg.se/photos/i- ... qSh-X2.jpg

S
Author:  spotdespot [ Mon Nov 17, 2014 12:27 pm ]
Post subject:  Cross Slopey Bob

Have you got ECN broker set to false on an ECN broker? It's the only thing I can think of.
Author:  alfarunner [ Mon Nov 17, 2014 1:25 pm ]
Post subject:  Cross Slopey Bob

Do you mean the parameter IsGlobalPrimeOrECNCriminal?
S
Author:  spotdespot [ Mon Nov 17, 2014 1:36 pm ]
Post subject:  Cross Slopey Bob

alfarunner » Mon Nov 17, 2014 2:25 pm wrote:Do you mean the parameter IsGlobalPrimeOrECNCriminal?
S
Yes - that's the one. If you are using Global Prime then I am definitely wrong as it doesn't matter (there are other code checks for Global Prime), but if you are using another ECN broker then this must be set to true.
Author:  alfarunner [ Mon Nov 17, 2014 1:55 pm ]
Post subject:  Cross Slopey Bob

Ok, but to me it should be the other way around. For me the parameter says "are you using Global Prime?". So the obvious answer should be false. But I'm not, I use Alpari.
S
All times are UTC Page 5 of 7