The screenshot was from Demo Live £1 lot size, however since this morning I am now running it “Real Live” with £0.2 lot size. So far 2 winning trades which matches my demo live test.
I am also testing since this morning a daily optmisation but letting each strategy run for 1 week. So splitting the strategy into 5, mon-fri, and running daily optmisation the evening before the day it goes live. So Renko-Tuesday.itf will be optimised on Monday evening and reoptimised 7 days later. Tuesday evening I’ll optimise Renko-Wednesday.itf and so on. I’ll let you know how that goes..
Daily optimsation has shown better results with different box sizes but the fixed settings has proven to work better for me (so far)
I use box size 50 and renko type 1, run in 5 seconds (not 10s as mentioned above)
No changes to the original code (I think) but posting my verison here for reference.
@GraHal
Yesterday wasn’t too bad 😉 but there was a big loss there too.
Applied machine learning on 2.3pR version, and results are AWESOME.
I will try today to apply it on every version and on every timeframe in order to find the best one 🙂
I’ll let you know how that goes..
Yes please … that will be well interesting an useful.
I got the S10 TF version going good now … backtest attached.
PS
Even better (2nd image) with the settings shown for Renko Type = 2 and Box size = 95.
First good version, 10sec.
Position size: 0.2
It only works between 8.00 to 21.00 in order to use just the lowest spreads available for DOW.
As you can see from the equity curve, the first day the system took a lot of trades in order to better optimize the machine learning algorithm values following my istructions; then, the system started to work normally with costant gains and trades.
So in a live trading optic, should be better to run it before 8am and not during the day, that could bring to losses.
I confirm that ML could be the best thing to fit into these short TF systems.
In addiction, still thinking in a live trading optic, I’d run a new system every Sunday evening: “sacrifice” the Monday in order to let the system better optimize itself, and taking gains the rest of the week; closing it Friday evening and starting a new one on Sunday again.
PaulParticipant
Master
maybe simulated trading between certain times or the first day to let the heuristic engine determine the values and then go live.
First good version, 10sec.
Will you be sharing your first good version?
Is there no way to avoid the ‘first day sacrifice’!? Poor System! 🙂
Why not optimise the settings before you set it going?
Above is what I did when I got a few ML Systems working. We could even do a walk forward and use the settings for starting value etc from the latest IS period … least then the System kicks off with a fighting chance? Or even just use settings from a normal 10k bars optimisation?
Is above what you do or do you guess / finger in the air for starting value etc?
Just asking / just saying! 🙂
PaulParticipant
Master
probably you had so many trades the first day, because the start values are way off the ideal ones.
What about taking the last values of your backtest, and put them in as starting values, or only slightly less.
I just talked about some random ideas in order to stimulate brainstorming, sacrificing some systems 🙂
Heres the valuex (renko type) and valuey (boxsize) that i’ve used on the 2.3pr 10sec.
P.S.: Reset periods are just randoms
// Heuristics Algorithm Start
If onmarket[1] = 1 and onmarket = 0 Then
optimize = optimize + 1
EnDif
StartingValue = 1
ResetPeriod = 0.5 //Specify no of months after which to reset optimization
Increment = 1
MaxIncrement = 1 //Limit of no of increments either up or down
Reps = 6 //Number of trades to use for analysis
MaxValue = 3 //Maximum allowed value
MinValue = increment //Minimum allowed value
once monthinit = month
once yearinit = year
If (year = yearinit and month = (monthinit + ResetPeriod)) or (year = (yearinit + 1) and ((12 - monthinit) + month = ResetPeriod)) Then
ValueX = StartingValue
WinCountB = 0
StratAvgB = 0
BestA = 0
BestB = 0
monthinit = month
yearinit = year
EndIf
once ValueX = StartingValue
once PIncPos = 1 //Positive Increment Position
once NIncPos = 1 //Neative Increment Position
once Optimize = 0 ////Initialize Heuristicks Engine Counter (Must be Incremented at Position Start or Exit)
once Mode = 1 //Switches between negative and positive increments
//once WinCountB = 3 //Initialize Best Win Count
//GRAPH WinCountB coloured (0,0,0) AS "WinCountB"
//once StratAvgB = 4353 //Initialize Best Avg Strategy Profit
//GRAPH StratAvgB coloured (0,0,0) AS "StratAvgB"
If Optimize = Reps Then
WinCountA = 0 //Initialize current Win Count
StratAvgA = 0 //Initialize current Avg Strategy Profit
For i = 1 to Reps Do
If positionperf(i) > 0 Then
WinCountA = WinCountA + 1 //Increment Current WinCount
EndIf
StratAvgA = StratAvgA + (((PositionPerf(i)*countofposition[i]*100000)*-1)*-1)
Next
StratAvgA = StratAvgA/Reps //Calculate Current Avg Strategy Profit
//Graph (PositionPerf(1)*countofposition[1]*100000)*-1 as "PosPerf1"
//Graph (PositionPerf(2)*countofposition[2]*100000)*-1 as "PosPerf2"
//Graph StratAvgA*-1 as "StratAvgA"
//once BestA = 300
//GRAPH BestA coloured (0,0,0) AS "BestA"
If StratAvgA >= StratAvgB Then
StratAvgB = StratAvgA //Update Best Strategy Profit
BestA = ValueX
EndIf
//once BestB = 300
//GRAPH BestB coloured (0,0,0) AS "BestB"
If WinCountA >= WinCountB Then
WinCountB = WinCountA //Update Best Win Count
BestB = ValueX
EndIf
If WinCountA > WinCountB and StratAvgA > StratAvgB Then
Mode = 0
ElsIf WinCountA < WinCountB and StratAvgA < StratAvgB and Mode = 1 Then
ValueX = ValueX - (Increment*NIncPos)
NIncPos = NIncPos + 1
Mode = 2
ElsIf WinCountA >= WinCountB or StratAvgA >= StratAvgB and Mode = 1 Then
ValueX = ValueX + (Increment*PIncPos)
PIncPos = PIncPos + 1
Mode = 1
ElsIf WinCountA < WinCountB and StratAvgA < StratAvgB and Mode = 2 Then
ValueX = ValueX + (Increment*PIncPos)
PIncPos = PIncPos + 1
Mode = 1
ElsIf WinCountA >= WinCountB or StratAvgA >= StratAvgB and Mode = 2 Then
ValueX = ValueX - (Increment*NIncPos)
NIncPos = NIncPos + 1
Mode = 2
EndIf
If NIncPos > MaxIncrement or PIncPos > MaxIncrement Then
If BestA = BestB Then
ValueX = BestA
Else
If reps >= 10 Then
WeightedScore = 10
Else
WeightedScore = round((reps/100)*100)
EndIf
ValueX = round(((BestA*(20-WeightedScore)) + (BestB*WeightedScore))/20) //Lower Reps = Less weight assigned to Win%
EndIf
NIncPos = 1
PIncPos = 1
ElsIf ValueX > MaxValue Then
ValueX = MaxValue
ElsIf ValueX < MinValue Then
ValueX = MinValue
EndIF
Optimize = 0
EndIf
// Heuristics Algorithm End
// Heuristics Algorithm 2 Start
If onmarket[1] = 1 and onmarket = 0 Then
optimize2 = optimize2 + 1
Endif
StartingValue2 = 20
ResetPeriod2 = 12 //Specify no of months after which to reset optimization
Increment2 = 5
MaxIncrement2 = 5 //Limit of no of increments either up or down
Reps2 = 1 //Number of trades to use for analysis
MaxValue2 = 100 //Maximum allowed value
MinValue2 = increment //Minimum allowed value
once monthinit2 = month
once yearinit2 = year
If (year = yearinit2 and month = (monthinit2 + ResetPeriod2)) or (year = (yearinit2 + 1) and ((12 - monthinit2) + month = ResetPeriod2)) Then
ValueY = StartingValue2
WinCountB2 = 0
StratAvgB2 = 0
BestA2 = 0
BestB2 = 0
monthinit2 = month
yearinit2 = year
EndIf
once ValueY = StartingValue2
once PIncPos2 = 1 //Positive Increment Position
once NIncPos2 = 1 //Neative Increment Position
once Optimize2 = 0 ////Initialize Heuristicks Engine Counter (Must be Incremented at Position Start or Exit)
once Mode2 = 1 //Switches between negative and positive increments
//once WinCountB2 = 3 //Initialize Best Win Count
//GRAPH WinCountB2 coloured (0,0,0) AS "WinCountB2"
//once StratAvgB2 = 4353 //Initialize Best Avg Strategy Profit
//GRAPH StratAvgB2 coloured (0,0,0) AS "StratAvgB2"
If Optimize2 = Reps2 Then
WinCountA2 = 0 //Initialize current Win Count
StratAvgA2 = 0 //Initialize current Avg Strategy Profit
For i2 = 1 to Reps2 Do
If positionperf(i) > 0 Then
WinCountA2 = WinCountA2 + 1 //Increment Current WinCount
EndIf
StratAvgA2 = StratAvgA2 + (((PositionPerf(i)*countofposition[i]*100000)*-1)*-1)
Next
StratAvgA2 = StratAvgA2/Reps2 //Calculate Current Avg Strategy Profit
//Graph (PositionPerf(1)*countofposition[1]*100000)*-1 as "PosPerf1-2"
//Graph (PositionPerf(2)*countofposition[2]*100000)*-1 as "PosPerf2-2"
//Graph StratAvgA2*-1 as "StratAvgA2"
//once BestA2 = 300
//GRAPH BestA2 coloured (0,0,0) AS "BestA2"
If StratAvgA2 >= StratAvgB2 Then
StratAvgB2 = StratAvgA2 //Update Best Strategy Profit
BestA2 = ValueY
EndIf
//once BestB2 = 300
//GRAPH BestB2 coloured (0,0,0) AS "BestB2"
If WinCountA2 >= WinCountB2 Then
WinCountB2 = WinCountA2 //Update Best Win Count
BestB2 = ValueY
EndIf
If WinCountA2 > WinCountB2 and StratAvgA2 > StratAvgB2 Then
Mode = 0
ElsIf WinCountA2 < WinCountB2 and StratAvgA2 < StratAvgB2 and Mode2 = 1 Then
ValueY = ValueY - (Increment2*NIncPos2)
NIncPos2 = NIncPos2 + 1
Mode2 = 2
ElsIf WinCountA2 >= WinCountB2 or StratAvgA2 >= StratAvgB2 and Mode2 = 1 Then
ValueY = ValueY + (Increment2*PIncPos2)
PIncPos2 = PIncPos2 + 1
Mode = 1
ElsIf WinCountA2 < WinCountB2 and StratAvgA2 < StratAvgB2 and Mode2 = 2 Then
ValueY = ValueY + (Increment2*PIncPos2)
PIncPos2 = PIncPos2 + 1
Mode2 = 1
ElsIf WinCountA2 >= WinCountB2 or StratAvgA2 >= StratAvgB2 and Mode2 = 2 Then
ValueY = ValueY - (Increment2*NIncPos2)
NIncPos2 = NIncPos2 + 1
Mode2 = 2
EndIf
If NIncPos2 > MaxIncrement2 or PIncPos2 > MaxIncrement2 Then
If BestA2 = BestB2 Then
ValueY = BestA
Else
If reps2 >= 10 Then
WeightedScore2 = 10
Else
WeightedScore2 = round((reps2/100)*100)
EndIf
ValueY = round(((BestA2*(20-WeightedScore2)) + (BestB2*WeightedScore2))/20) //Lower Reps = Less weight assigned to Win%
EndIf
NIncPos2 = 1
PIncPos2 = 1
ElsIf ValueY > MaxValue2 Then
ValueY = MaxValue2
ElsIf ValueY < MinValue2 Then
ValueY = MinValue2
EndIF
Optimize2 = 0
EndIf
// Heuristics Algorithm 2 End
Sorry for my newbie-question but how do i implement Francescos mashinelearning Valuex and ValueY in to the 2.3 version of the system?
So exciting following these threads with your genius codes, hope to someday be able to contribute with something as well. Wish you all a nice weekend!
I’m everything but not a genius coder 🙂
I’m still a newbie but reading everyday the forum since months and doing hundreds of tests on the platform i’m starting learing something. It becomes fun and fascinating especially when you are surrounded by the people of this section that works everyday for new challenges with strong motivations.
Btw, if you want the answer to your question and start learning something, you can study this topic https://www.prorealcode.com/topic/machine-learning-in-proorder/ and you will easily understand in few pages how to implement the ML in the code.
Today “Real Live” results. Positionsize 0.2.
PaulParticipant
Master
nice! how many % or points did you set the stoploss?
Maxloss was set to 1 – does this part of the code act as a stop loss? I didn’t add a ‘set stop loss x’ code and wasn’t sure so I was watching the screen when the trades were on 🙂
It seems to be the entry is not perfect, but it’s probably very difficult to achieve that on this timeframe. However, it has a high win rate so it often ends up in profit as can be seen in my previous demo forward-test.
A tight stop loss will definatly see less wins. I don’t know how we can resolve this without adding too many parameters to the strategy. I was looking into oscillators on different timeframes, and voss predictive filter, but haven’t yet found anything that works well.
Any ideas?