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

Slopey Slope
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=745
Page 3 of 9
Author:  hilavoku [ Sat Aug 18, 2012 11:42 am ]
Post subject:  Re: Slopey Slope

Hi Steve,

i totally agree with the statement : 'never change a running system' . :!:
When you say the cpu load of an integrated indi can be neglected than it's okay. I haven't checked this.

But the changes to be made are not that much and i think you can use those in many other EA's...

The second thing i mentioned was about the calculation of the variable 'PrevLtfSlopeVal' . In the 'start' function i added the following line:

Code: Select all

Print("LtfSlopeVal = ", LtfSlopeVal, "   PrevLtfSlopeVal = ", PrevLtfSlopeVal, "\n");
The output given within a single day when setting Htf = 1440 Ltf = 15 trading time frame = 240 i got the following output in the journal:

  • 2012.08.18 12:46:15 2012.08.13 12:00 Slopey Slope EURUSD,M15: LtfSlopeVal = 0.7072 PrevLtfSlopeVal = -0.3173

    2012.08.18 12:46:15 2012.08.13 08:00 Slopey Slope EURUSD,M15: LtfSlopeVal = 0.1943 PrevLtfSlopeVal = -0.3173

    2012.08.18 12:46:15 2012.08.13 04:00 Slopey Slope EURUSD,M15: LtfSlopeVal = -0.175 PrevLtfSlopeVal = -0.3173

    2012.08.18 12:46:14 2012.08.13 00:00 Slopey Slope EURUSD,M15: LtfSlopeVal = -0.2773 PrevLtfSlopeVal = -0.3173

    2012.08.18 12:46:14 2012.08.13 00:00 Slopey Slope EURUSD,M15: open #1 buy 0.01 EURUSD at 1.22890 sl: 1.21890 tp: 1.24890 ok
    2012.08.18 12:46:14 Slopey Slope inputs: Lot=0.01; RiskPercent=0; TakeProfitPips=200; StopLossPips=100; MagicNumber=0; MaxSpread=12; MaxSlippagePips=5; TradingTimeFrame=240; PipsHiddenFromCriminal=0; HiddenPips=0; HtfTimeFrame=1440; HtfBuyLevel=0; HtfSellLevel=0; LtfTimeFrame=15; LtfBuyLevel=0; LtfSellLevel=0; start_hourm=0; end_hourm=12; start_houre=12; end_houre=24; BreakEvenTargetPips=50; BreakEvenTargetProfit=10; CstTimeFrame=0; CstTrailCandles=1; JumpingStopTargetPips=50; TrailingStopTargetPips=20; DisplayGapSize=30;
    2012.08.18 12:44:51 Slopey Slope: loaded successfully


As you can see the value of 'PrevLtfSlopeVal' doesn't change within those 24 hours. But it should change like 'LtfSlopeVal' does. So this is a faulty calculation and therefore also the angle of the slope.

I did the needed changes and the output now looks like this:

  • 2012.08.18 13:36:18 2012.08.13 20:00 Slopey Slope_repaired EURUSD,M15: LtfSlopeVal = -0.6429 PrevLtfSlopeVal = -0.6464

    2012.08.18 13:36:18 2012.08.13 16:00 Slopey Slope_repaired EURUSD,M15: LtfSlopeVal = 1.6725 PrevLtfSlopeVal = 1.786

    2012.08.18 13:36:18 2012.08.13 13:00 Slopey Slope_repaired EURUSD,M15: modify #1 buy 0.01 EURUSD at 1.22890 sl: 1.22990 tp: 1.24890 ok
    2012.08.18 13:36:18 2012.08.13 12:00 Slopey Slope_repaired EURUSD,M15: LtfSlopeVal = 0.7072 PrevLtfSlopeVal = 0.8338

    2012.08.18 13:36:18 2012.08.13 08:00 Slopey Slope_repaired EURUSD,M15: LtfSlopeVal = 0.1943 PrevLtfSlopeVal = 0.2748

    2012.08.18 13:36:17 2012.08.13 04:00 Slopey Slope_repaired EURUSD,M15: LtfSlopeVal = -0.175 PrevLtfSlopeVal = -0.1852

    2012.08.18 13:36:17 2012.08.13 00:00 Slopey Slope_repaired EURUSD,M15: LtfSlopeVal = -0.2773 PrevLtfSlopeVal = -0.3173

    2012.08.18 13:36:17 2012.08.13 00:00 Slopey Slope_repaired EURUSD,M15: open #1 buy 0.01 EURUSD at 1.22890 sl: 1.21890 tp: 1.24890 ok
    2012.08.18 13:36:17 Slopey Slope_repaired inputs: Lot=0.01; RiskPercent=0; TakeProfitPips=200; StopLossPips=100; MagicNumber=0; MaxSpread=12; MaxSlippagePips=5; TradingTimeFrame=240; PipsHiddenFromCriminal=0; HiddenPips=0; HtfTimeFrame=1440; HtfBuyLevel=0; HtfSellLevel=0; LtfTimeFrame=15; LtfBuyLevel=0; LtfSellLevel=0; start_hourm=0; end_hourm=12; start_houre=12; end_houre=24; BreakEvenTargetPips=50; BreakEvenTargetProfit=10; CstTimeFrame=0; CstTrailCandles=1; JumpingStopTargetPips=50; TrailingStopTargetPips=20; DisplayGapSiz


So now both values are changing every trading timeframe and showing the last values from 1*15 min and 2*15 (30) min before. As it should be.

The attachment is the modified version. Would be nice if someone also can take a look into the code...

happy weekend :)
Guido


PS: Harry45 got a version of slopeyslope from me which also includes the difference between two slope values and when a threshold is reached it takes a trade. The modifications i did now are also included in this EA and he says that there are no errors and seems to function the right way...
Author:  Zypip [ Mon Aug 20, 2012 7:24 am ]
Post subject:  Re: Slopey Slope

hilavoku wrote:Hi Steve,

i totally agree with the statement : 'never change a running system' . :!:
When you say the cpu load of an integrated indi can be neglected than it's okay. I haven't checked this.

But the changes to be made are not that much and i think you can use those in many other EA's...

The second thing i mentioned was about the calculation of the variable 'PrevLtfSlopeVal' . In the 'start' function i added the following line:
Hi there,

Just tried your version of the Slopeyslope and opened 20 sell trades when many of the pairs' slope I am watching were actually rising :? In contrast, Steve's version seemed to work alright. Not a criticism of course, just sharing my observations.

Cheers,

Zyp
Author:  hilavoku [ Mon Aug 20, 2012 7:43 am ]
Post subject:  Re: Slopey Slope

Thanks for the feedback Zyp. I just changed some lines in the 'ReadIndicatorValues' function. Even when Steve's version seems to work at the moment it calculates the wrong values as i stated above. This doesn't also mean that my version is 100% right :-|

Also personally i think that the information about the TMA rising or falling is not that meaningful. The difference between the current TMA and the previous TMA could be as little than 0.001. But on this information and the TMA value itself, i don't think you can say; 'okay the TMA is rising i go for long'. I think we should add an additionally threshold for the minimum difference between those two values as i said some post's before. But this is another story...


I found a copy and paste thingy. So it would be nice if you give it another try... (attachment updated in above post)

thx in advance
Guido
Author:  Zypip [ Mon Aug 20, 2012 7:56 am ]
Post subject:  Re: Slopey Slope

hilavoku wrote:Thanks for the feedback Zyp. I just changed some lines in the 'ReadIndicatorValues' function. Even when Steve's version seems to work at the moment it calculates the wrong values as i stated above. This doesn't also mean that my version is 100% right :-|

I will look at the code and can you give me some trades the EA has taken which seem to go wrong?

thx in advance
Guido

PS: I found a copy and paste thingy. So it would be nice if you give it another try... (attachment updated in above post)
Thanks Guido, not home at the mo but will try later today and report.

Cheers,

Zyp


EDIT: tried the new version but still only sell trades open :?
Author:  hilavoku [ Mon Aug 20, 2012 7:46 pm ]
Post subject:  Re: Slopey Slope

Hi Zyp,

can you give me the info about one or two of the taken sell trades? Did you delete the .ex4 file or recompiled the indi?!

thx
Guido

PS: I added the EA to AUDCAD and it immediately trys to take a BUY order. Which fails with error 130... :o


2012.08.20 21:52:03 Slopey Slope_repaired AUDCAD,H1: Alert: AUDCAD Slopey Slope_repaired OP_BUY order send failed with error(130): invalid stops


(A backtest shows that the EA takes long and short positions.)

sincerely
Guido
Author:  SteveHopwood [ Mon Aug 20, 2012 9:04 pm ]
Post subject:  Re: Slopey Slope

hilavoku wrote:Thanks for the feedback Zyp. I just changed some lines in the 'ReadIndicatorValues' function. Even when Steve's version seems to work at the moment it calculates the wrong values as i stated above. This doesn't also mean that my version is 100% right :-|
Just so you know, Guido, the values calculated are those of the 10.2 TMA slope v.1.4B 4.30 indi and are correct on my charts.

The EA is doing as I want it to, for now. What I want it to do may change.

:D
Author:  hilavoku [ Tue Aug 21, 2012 7:45 am ]
Post subject:  Re: Slopey Slope

SteveHopwood wrote:
hilavoku wrote:Thanks for the feedback Zyp. I just changed some lines in the 'ReadIndicatorValues' function. Even when Steve's version seems to work at the moment it calculates the wrong values as i stated above. This doesn't also mean that my version is 100% right :-|
Just so you know, Guido, the values calculated are those of the 10.2 TMA slope v.1.4B 4.30 indi and are correct on my charts.

The EA is doing as I want it to, for now. What I want it to do may change.

:D
Hope the best ;)

The TMA value calculation itself is correct thats for shure but the time the values are updated isn't. As i stated above, the lower timeframe previous tma value is only updated every higher timeframe...

Code: Select all

if (OldBarTime != iTime(NULL, HtfTimeFrame, 0) )
      {
         PrevLtfSlopeVal = GetSlope(Symbol(), LtfTimeFrame, 2);
      }//if (OldBarTime != iTime(NULL, HtfTimeFrame, 0)
That is not correct 'PrevLtfSlopeVal' should updated every 'LtfTimeFrame'. When the 'LtfSlopeVal' changes then also 'PrevLtfSlopeAngle' must change like i posted here: http://www.stevehopwoodforex.com/phpBB3 ... 5&start=26

Would be nice if someone else can look at the function 'ReadIndicatorValues' and give his thoughts to us. I also spent a lot of time into this before i post something where i say that a calculation is wrong. Especially when its from you Steve! :?


see you
Guido
Author:  Zypip [ Tue Aug 21, 2012 7:56 am ]
Post subject:  Re: Slopey Slope

hilavoku wrote:Hi Zyp,

can you give me the info about one or two of the taken sell trades? Did you delete the .ex4 file or recompiled the indi?!

thx
Guido

PS: I added the EA to AUDCAD and it immediately trys to take a BUY order. Which fails with error 130... :o


2012.08.20 21:52:03 Slopey Slope_repaired AUDCAD,H1: Alert: AUDCAD Slopey Slope_repaired OP_BUY order send failed with error(130): invalid stops


(A backtest shows that the EA takes long and short positions.)

sincerely
Guido
Hi Guido,

Sorry for being bother. Did not recompile the EA as I thought Empty4 should do that when the restart during initialisation, which I did. I thought it was not an issue at my end on the basis that Steve's version was opening correctly short/long trades according to whether the H4 slope was rising or decreasing. Also, I did not upgrade yet to the 432 build but will do soon.

At the mo I have the slopeyslope EA running on about 18 pairs and Baluda's basket management EA running on another pair so that I would take profit whenever the total profit reaches X pips.

Anyway, I does seem to take longs and shorts on your machine so it is probably something I have to sort out at my end.

Cheers,

Zyp
Author:  hilavoku [ Tue Aug 21, 2012 8:17 am ]
Post subject:  Re: Slopey Slope

Thx for the info Zyp.

Hope the EA serves you well and will take some longs for you. Read my thoughts about a threshold. I think it would be an usefull addition.

sunny greetings from germany
Guido
Author:  SteveHopwood [ Tue Aug 21, 2012 9:50 am ]
Post subject:  Re: Slopey Slope

hilavoku wrote:
SteveHopwood wrote:
hilavoku wrote:Thanks for the feedback Zyp. I just changed some lines in the 'ReadIndicatorValues' function. Even when Steve's version seems to work at the moment it calculates the wrong values as i stated above. This doesn't also mean that my version is 100% right :-|
Just so you know, Guido, the values calculated are those of the 10.2 TMA slope v.1.4B 4.30 indi and are correct on my charts.

The EA is doing as I want it to, for now. What I want it to do may change.

:D
Hope the best ;)

The TMA value calculation itself is correct thats for shure but the time the values are updated isn't. As i stated above, the lower timeframe previous tma value is only updated every higher timeframe...

Code: Select all

if (OldBarTime != iTime(NULL, HtfTimeFrame, 0) )
      {
         PrevLtfSlopeVal = GetSlope(Symbol(), LtfTimeFrame, 2);
      }//if (OldBarTime != iTime(NULL, HtfTimeFrame, 0)
That is not correct 'PrevLtfSlopeVal' should updated every 'LtfTimeFrame'. When the 'LtfSlopeVal' changes then also 'PrevLtfSlopeAngle' must change like i posted here: http://www.stevehopwoodforex.com/phpBB3 ... 5&start=26

Would be nice if someone else can look at the function 'ReadIndicatorValues' and give his thoughts to us. I also spent a lot of time into this before i post something where i say that a calculation is wrong. Especially when its from you Steve! :?


see you
Guido
Thanks again, Guido. I misunderstood what you were saying. I had not noticed the lower time frame problem because I have not used the ltf yet.

Version 1b is in post 1, with the time thingy corrected. I noticed a couple of other oddities whilst doing this, and fixed those as well.

:D
All times are UTC Page 3 of 9