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");- 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...