And my account was deleted not for the comments on this site…comments out of here from other peopple outside here hehehe.. Really they told me my system is not sure and i though better no work on it because i dont want peopple could lose..just for this…Is my first time and i know 100% is impossible but check this…first day i uploaded my roboit to other comunity my email were burning.Everyone wrote me. Peopple believed that found the philosopher’s stone without even bothering to look the code and help to improve it…that’s not what i want..i want peopple checking code ante telling me what should i correct it..
First time many mistakes
Well i dont know if here can type email adresses but if anyone want help me and have direct contact is
Moderator’s edit: no email address in PRC forums please, thanks
Welcome back and good to have you here.
Juan S. Amazing find regarding the missing ( ) haha. Will continue to run this live as well 🙂 Not going crazy on amount of contracts though hehe
JI Juanan ,
unfortunattly today another STOP …
thanks
Now i’m working on this…just started and please check results….same automatism in diferents markets and diferents tf…
Good Juan! Keep working 🙂
Regarding you asking for help with your code, im sorry to say that between trying to translate to english and the amount of code, im pretty much useless 🙂
however i do have access to 200K backtest and i got no problem running walk forward for you if you need.
edit: Btw both Juans, the code was missing several “( )” not just the one! 🙂
hahaha surely Jebus so if u can correct it?…i can test now in 200k so many thx.Surely there’s many many missings things on code but maybe with the “base” we can do it better or more strong adding or editing something
Indeed Juan. Its very hard trying to optimize something that works 100% though hehe! Will give it a couple of tries and see what i find.
Dear Juanan71, congratulations for your code, it is wonderfull!!!
I have a doubt, is it possible to have maxdrawdown if you have not losses? When I have tested the code I had 45 € of maxdrawdown with 1 minicontract (1€) and 500 € initial deposit in IG. This question is for all, I would appreciate anyone to answer me.
You are correct, without losing trades, there is no drawdown. 🙂
Max DD you can have in 1 trade are 28 pt if it lose so you can lose 28 pts or 25 for every trade…take care your capital/risk..
For a 800€ account i will trade less than 1€ per contract
PaulParticipant
Master
Hi Juanan71
Your code looks very large and produces excellent results in the backtest! Thanks for sharing and give the opportunity to learn and modify!
Looking at the results of last couple of days. The first upload had a loss, and the modified upload had more remarkably two losses in a row. So how is that possible with a backtest so great ?
I like the code core to be tested without time criteria. Also not with specific profit-targets or stop-losses for certain times. I started to work on this and it’s functional. If wanted I will post this.
When looking in the code, I wonder why this works?
sellshort = NOT LONGONMARKET and time= 152000 and c1444 and c2444 and c11444 and c111444 and c112444
but
buy = NOT SHORTONMARKET and time= 155200 and c1444 and c2444 and c11444 and c111444 and c11244
so besides the time factor criteria the same rules are set to go long and short ? (row 131)
I hope you don’t mind the critical look. It’s only to get a better understanding what is happening and why it works the way it works!
i’ll tell u…because i’m novel and is my first robot:) there’s many many wrong lines, i know..master version continues = fails and 100% because 2 last fails was just for i forgot include…if not longonmarket or if not longomarket in all shooting sentences…
Oh about rules you said..yes not allways same rules gave u the same result but changing just hour and minute depending of this indicators change the values…so it can be same indicators rules and fierente hour and time for a diferent results and price direction:) so easy like this
PaulParticipant
Master
I took the first criteria from your code for long and short and put that separate.
It matches your win-ratio. 12 trades, 12 wins.
So the reasoning is that when indicators criteria are met (long and short have same criteria), it goes to market at the specific time which is set the code. Time decides if the trade goes long or short, whichever time is first met in the code.
So here is how the chart look with time criteria and without. When time-criteria removed long and short can happen on the same bar.
As I understand it, if you have a losing system. Look at the time the winning trades occur, set these times in the code and optimise profit-target. You have a 100% winning strategy in the backtest. I’am curious to other opinions.
//-------------------------------------------------------------------------
// Main code : test
//-------------------------------------------------------------------------
// common rules
DEFPARAM CUMULATEORDERS = false
DEFPARAM PRELOADBARS = 10000
//DEFPARAM FLATBEFORE = 100000
//DEFPARAM FLATAFTER = 200000
// time rules
ONCE entertime = 080000
ONCE lasttime = 160000
ONCE closetime = 183000
ONCE closetimefriday=183000
tt1 = time >= entertime
tt2 = time <= lasttime
tradetime = tt1 and tt2
// positionsize and stops
positionsize=1
SLpLOSS=28
// setup number of trades intraday
if IntradayBarIndex = 0 then
longtradecounter = 0
Shorttradecounter = 0
endif
// trade criteria
lc = tradetime and countoflongshares < 1 and longtradecounter < 10 and not shortonmarket
sc = tradetime and countofshortshares < 1 and shorttradecounter < 10 and not longonmarket
// indicator
indicator1444 = SmoothedStochastic[14,3](close)
indicator2444 = Average[5](indicator1444)
c1444 = (indicator1444 >= indicator2444)
indicator3444 = ADX[14]
indicator4444 = ADXR[14]
c2444 = (indicator3444 >= indicator4444)
indicator11444 = Average[50](close)-Average[127](close)
c11444 = (indicator11444 > indicator11444[2])
indicator111444 = ROC[12](close)
c111444 = (indicator111444 >= 0)
indicator112444 = Average[50](close)-Average[127](close)
c112444 = (indicator112444 >= 0)
//nuevos largos 25 puntos
//l251=time= 150400 and c1444 and c2444 and c11444 and c111444 and c112444
//l252=time= 152800 and c1444 and c2444 and c11444 and c111444 and c112444
l253=time= 155200 and c1444 and c2444 and c11444 and c111444 and c112444//12 puntos
//nuevos cortos 25 puntos
c251=time= 152000 and c1444 and c2444 and c11444 and c111444 and c112444
c252=time= 154000 and c1444 and c2444 and c11444 and c111444 and c112444
c253=time= 154900 and c1444 and c2444 and c11444 and c111444 and c112444
c254=time= 155000 and c1444 and c2444 and c11444 and c111444 and c112444
// long entry
if lc and l253 then
buy positionsize lot at market
longtradecounter=longtradecounter + 1
hora=66
endif
// short entry
if sc and (c251 or c252 or c253 or c254) then
sellshort positionsize lot at market
shorttradecounter=shorttradecounter + 1
hora=67
endif
// exit all
If onmarket then
if time >= closetime then
sell at market
exitshort at market
elsif (CurrentDayOfWeek=5 and time>=closetimefriday) then
sell at market
exitshort at market
endif
endif
if IntradayBarIndex = 0 then
hora=0
set target pprofit 25
elsif hora=66 then
set target pprofit 12
elsif hora=67 then
set target pprofit 25
endif
SET STOP pLOSS SLpLOSS
//GRAPH 0 coloured(300,0,0) AS "zeroline"
//GRAPH (positionperf*100)coloured(0,0,0,255) AS "PositionPerformance"