Forex Factory (https://www.forexfactory.com/forum.php)
-   Trading Systems (https://www.forexfactory.com/forumdisplay.php?f=71)
-   -   Stochastic EA (https://www.forexfactory.com/showthread.php?t=571191)

Rijfie Dec 21, 2015 7:16am | Post# 1

9 Attachment(s)
Hello

I Created a expert adviser based on the stochastic.
It opens a trade when stochastic and rsi is low or high.
And when price is between maxprice and lowprice.
latest version is Rijfie stochastic rsi 4 uur versie 001 test.ex4

font color (breakevenline)
font/size (breakevenline)
fictiveloss (can be used with martingale starts trading after 0-6 losses)
balans (only buys when tradebalans is over balans)
Maxprice (above this level no trade is taken)
Lowprice (below this level no trade is taken)
lossbeforetrading
kperiod (RSI)
dperiod (RSI)
slowing (RSI)
steplevel (with martingale price must be lower before buying again)
rsitime (select timeframe)
rsihigh
rsilow
highlevel (stochastic)
lowlevel (stochastic)
stoploss (0 means no stoploss)
takeprofit (0 means no takeprofit in version 009 thit doesn't work because of trail) (in version 011 you can set the takeprofit now trail doesn't work)
magicnumber
difference (here you can change the difference between last stochastic and present stochastic )
range (range between ma50 and price )
lot ( if all lot are 0.01 then every buy or sell is 0.01 when double lot then you can use it as martingal)
Click to Enlarge

Name: settings.PNG
Size: 40 KB

This is the way i set up my tradings.

- I am using Rijfie stochastic rsi 4 uur versie 001 test.mq4
- Determine your directions for the currency next day or days.(I use calculating fundamentel data from tradingecomics try to update every day)
- Trade only in the direction you find.
- Set high and low price in ea.(So you won't take any trades outsite your defined price.)
- When ea opens trade then set your takeprofit (low risk) to the first line from your pivot lines.
- see pivot trading for indicators (special thanks to Davit).
- if you like to post use Donald.tpl please.



Attachment 1816679
Rijfie stochastic versie 009 test.mq4
Rijfie stochastic versie 011 test.mq4
Rijfie stochastic versie 012 test.mq4
Rijfie stochastic versie 014 test.mq4
Rijfie stochastic versie 023 test.mq4
Rijfie stochastic rsi 4 uur versie 001 test.mq4
Name:  indicators.PNG
Views: 1532
Size:  9 KB
Donald.tpl

Rijfie Dec 21, 2015 7:19am | Post# 2

1 Attachment(s)
Have a trade open now.
Many times when in profit i just close the trade.
Click to Enlarge

Name: Screenshot1.png
Size: 76 KB

CrazyOz Dec 21, 2015 9:04pm | Post# 3

Have a trade open now. Many times when in profit i just close the trade. {image}
Why.? Surely if the EA is efficient your SL & TP should be automatic without the need of manual intervention.
Does this EA work on other time frames. If placed on another time frame will it recognize the time frame.?
Cheers

Rijfie Dec 22, 2015 1:22am | Post# 4

{quote} Why.? Surely if the EA is efficient your SL & TP should be automatic without the need of manual intervention. Does this EA work on other time frames. If placed on another time frame will it recognize the time frame.? Cheers
Yes it works on all timeframes.
No it is not profitable. I haven't found the best setting.
And i hope that there is a programmer who also likes to work on it and willing to share.

But it does filter out some bad trades.

CrazyOz Dec 22, 2015 1:50am | Post# 5

{quote} Yes it works on all timeframes. No it is not profitable. I haven't found the best setting. And i hope that there is a programmer who also likes to work on it and willing to share. But it does filter out some bad trades.
OK Thanks. I will play with the settings. Looks to be a good candidate for the 15m

polindo Dec 22, 2015 5:39am | Post# 6

{quote} Yes it works on all timeframes. No it is not profitable. I haven't found the best setting. And i hope that there is a programmer who also likes to work on it and willing to share. But it does filter out some bad trades.
I made some back test setting martingala and my test is on course from January 2000 till now.
I started from 0.01 lot (x2 martingala) and 1500 euro base account.
Test is not finish but at the moment I have great result.

Next days I will post the final result with report.

polindo Dec 22, 2015 5:40am | Post# 7

My setting is TP 200 SL 200 and TF M1

machine25 Dec 24, 2015 7:29am | Post# 8

2 Attachment(s)
Hello rijfie,

I don't have time to look at the EA, sorry about that,
but next time I have done one EA, which requirement are still the same, so i repost it.

Here is the backtest, same TP same SL, and it will be a pure martingale because entries on stochastic 5 3 3 are ramdom entries.
one's can see that there is small profit but very big drawdown, and it allways end up crashing the acccount, because ot consecutive loss, over 13 or more. (40 lots starting with 0.01 lot)

Have a look at it, the code is not difficult

Click to Enlarge

Name: StrategyTester 24 12 15.gif
Size: 19 KB

the problem is the number of loss in a row. If someone is able to decrease the number of loss, using indicator, it will be safer. Even if people of MT4 say it is better to increase lot on winning orders than on losing one.

,
sto_rijfie_II.mq4

Rijfie Dec 24, 2015 1:06pm | Post# 9

Hello rijfie, I don't have time to look at the EA, sorry about that, but next time I have done one EA, which requirement are still the same, so i repost it. Here is the backtest, same TP same SL, and it will be a pure martingale because entries on stochastic 5 3 3 are ramdom entries. one's can see that there is small profit but very big drawdown, and it allways end up crashing the acccount, because ot consecutive loss, over 13 or more. (40 lots starting with 0.01 lot) Have a look at it, the code is not difficult {image} the problem is the number...
Hi machine25

No problem.
But just take a look at mine ea. You are able to change lot. So instead off double it you can put a 1.4 factor in it. just try it.

machine25 Dec 25, 2015 4:29am | Post# 10

{quote} Hi machine25 No problem. But just take a look at mine ea. You are able to change lot. So instead off double it you can put a 1.4 factor in it. just try it.
Hi rijfie,

I have a look at the code, i see a lot of improvement and new thing which can be useful in futur EA.

To modify the lot it is sufficient to use a formula, i think it is something like this
lot = MathPow(consecutive_loss, factor);

It's quite easy, then replace it in each one of the loop and that"s it. This will be a minor change which will slightly affect the behaviour of the EA.

The Pyramid EA was a much better idea, it deserve to be studied, unfortunately, coding is very much time consuming, even simple thing take days ...

Have nice day.

5aztv88 Dec 25, 2015 4:36am | Post# 11

i realized on big sl , ea suddenly open trade with high lot . i mean trade was with lot 0.03 and next trade is with 2 lot , and next trade again 0.03 lot .

machine25 Dec 25, 2015 4:44am | Post# 12

i realized on big sl , ea suddenly open trade with high lot . i mean trade was with lot 0.03 and next trade is with 2 lot , and next trade again 0.03 lot .
Then there is a bug, Saztv, check the code where consecutive loss give 0.03 lot, should be 2 or 3 consecutive loss, may be there is an error there,

add a line to check when the error occur, just after the order is taken :

Inserted Code
        if( ticket >  0 )
          {
         Print( "      lots =", DoubleToString(lots_loser,2), "   consecutive_loss  ", (string) consecutive_loss,    "   Error   ", ErrorDescription(GetLastError()) );
          }

Rijfie Dec 25, 2015 5:08pm | Post# 13

There are many ways to use this ea as martingale. But ther is always the risk from to many losses in a row.
So letīs try to let the lot on 0.01 and find a way to make it work.
I really would like to know if this is even possible. Already tried many backtests on 1 min chart but no luck sofar. 15 min looks promissing.
If there is someone who has already profitable ea then it will be great if you like to share.

Black Fox Dec 26, 2015 8:54am | Post# 14

Here is one stochastic EA from the past. Maybe you can re-use code, idea or something...
http://www.forexfactory.com/showthre...46#post7031446

oneffone Dec 27, 2015 2:07am | Post# 15

3 Attachment(s)
here is one stochastic ea from the past. Maybe you can re-use code, idea or something... http://www.forexfactory.com/showthre...46#post7031446

WhiteHorse Stoch fixed.modi01.mq4
Click to Enlarge

Name: StrategyTester.gif
Size: 11 KB
xyz.zip

Rijfie Dec 27, 2015 4:21am | Post# 16

3 Attachment(s)
Here is a martingale test with following settings and reports
eur/usd 1min chart for about 6 weeks.
Click to Enlarge

Name: Screenshot1.png
Size: 27 KB
Click to Enlarge

Name: Screenshot2.png
Size: 39 KB
Click to Enlarge

Name: Screenshot3.png
Size: 53 KB

Rijfie Jan 1, 2016 9:28am | Post# 17

hello

version 011 test uploaded.
Now trail is not working but you can set takeprofit.

Rijfie Jan 1, 2016 1:53pm | Post# 18

3 Attachment(s)
hello

Backtest on 1min eur/usd.
Click to Enlarge

Name: Screenshot1.png
Size: 49 KB
Click to Enlarge

Name: Screenshot2.png
Size: 43 KB
Click to Enlarge

Name: Screenshot3.png
Size: 39 KB

Rijfie Aug 4, 2016 5:41am | Post# 19

1 Attachment(s)
​Need some help with coding.

I need the expert to stop trading after a profit. And if i like to trade again i can switch bool to true manual.
I guess i need a bool but don't know how.
I hope there is a programmer who would like to check Rijfie stochastic versie 011 test.mq4

Rijfie Aug 7, 2016 8:35am | Post# 20

1 Attachment(s)
New version checks account amount.
If new profit is higher then account the expert stops trading. You have to change balans (just 1 euro or dollar above your balance)
You can also put a much higher value with balans then the expert keeps on trading.

Rijfie stochastic versie 012 test.mq4


© Forex Factory