Write as below
IF high > renkoMax + boxSize THEN
//WHILE high > renkoMax + boxSize
renkoMax = renkoMax + boxSize
renkoMin = renkoMin + boxSize
//WEND
ELSIF low < renkoMin - boxSize THEN
//WHILE low < renkoMin - boxSize
renkoMax = renkoMax - boxSize
renkoMin = renkoMin - boxSize
//WEND
ENDIF
Here we are @Bard … see above help from Fifi … it might solve some of your mysteries re change in results etc?
Let us know if it helps?
PS
I even found a while back that a System was repeatedly getting rejected and when I replaced While and Wend the System worked fine!
So I reckon we need to avoid / replace While and Wend whenever we see it in code??
First image with while and the second one without
BardParticipant
Master
Thanks for the code Vonasi, I must be doing something wrong because I cannot get the Nonetheless VRT turned off system, to match the system results that I have with no VRT code in it.
Have I misread your VRT on/off instructions? :–
This code below is in the Nonetheless version and gives a profit of £201k. My non VRT version gives a profit of £55k. Cheers.
//DEFPARAM FLATAFTER = 210000
RobustnessTest = 0
StartDate = 0//20000101
//Qty = 10
//Random = 3
Qty = q //(go to opt variables and set q b/w 2 and 10 )
Random = r //(go to opt variables r b/w 1 and 10)
once j = 0
once flag = 1
if flag = 1 then
j = j + 1
if j > qty then
flag = -1
j = j - 1
endif
endif
if flag = -1 then
j = j - 1
if j = 0 then
j = j + random
flag = 1
endif
endif
tradeon = 0
if opendate >= startdate then
if barindex mod qty = 0 or barindex mod qty = j then
tradeon = 1
endif
endif
if not RobustnessTest then
tradeon = 1
endif
//Money Management
Write as below
Thanks Fifi – very helpful as always! – but this is now duplicating work already done at the beginning of the Pure Renko strategy thread. See #120416
BardParticipant
Master
Afternoon @Fifi, and @GraHal, I got the While and Wend from a GraHal post on the first page of the Pure Renko Forum which was based on DocTrading’s version of Renko here: https://www.prorealcode.com/prorealtime-trading-strategies/pure-renko-strategy/
I got far worse results when I took While/Wend out and used Paul’s simplified version: https://www.prorealcode.com/topic/discussion-re-pure-renko-strategy/#post-120416
Pls see £/$ Monthly screens. (I still laugh at how I couldn’t get the 1 min Renko to make money so I thought they must mean 1 month because look at the great results)! Note: This is not tick by tick results. Please my next post on how much tick by tick data PRT supplies courtesy of Anton at IG Index.
Could you please explain what the code with While/Wend does? I looked it up when I first came across it and found this example:
Syntax
While <expression>
...
Wend
Description
Wend will loop until the <expression> becomes false. A good point to keep in mind with a While test is that if the first test is false, then the program will never enter the loop and will skip this part.
A Repeat loop is executed at least once, (as the test is performed after each loop).
With the Break command it is possible to exit the While : Wend loop during any iteration, with the Continue command the end of the current iteration may be skipped.
Example
b = 0
a = 10
While a = 10
b = b+1
If b=10
a=11
EndIf
Wend
This program loops until the 'a' value is <> (not equal to) 10. The value of 'a' becomes 11 when b=10, the program will loop 10 times.
https://www.purebasic.com/documentation/reference/while_wend.html
So...
once renkoMax = ROUND(close / boxSize) * boxSize
once renkoMin = renkoMax - boxSize
IF high > renkoMax + boxSize THEN
WHILE high > renkoMax + boxSize
renkoMax = renkoMax + boxSize
renkoMin = renkoMin + boxSize
WEND
ELSIF low < renkoMin - boxSize THEN
WHILE low < renkoMin - boxSize
renkoMax = renkoMax - boxSize
renkoMin = renkoMin - boxSize
WEND
ENDIF
c1 = renkoMax + boxSize
c2 = renkoMin - boxSize
// Conditions to enter long positions
If c1 then
Buy N CONTRACT at renkoMax + boxSize stop
EndIf
// Conditions to enter short positions
If c2 then
Sellshort N CONTRACT at renkoMin - boxSize stop
EndIf
// Stops and targets
//SET STOP PLOSS ValueX //75
Set stop trailing ValueX//100
SET TARGET PPROFIT 500 //Orig 150
Discussion re Pure Renko strategy
BardParticipant
Master
PRT Tick By Tick Data Lengths from an IG Index email this morning:
“Below is a breakdown of the Historical data limits on Prorealtime:
Tick data; (Tick by tick, 1 minute, 2 minute and 3 minute): 2 days.
Intraday data: 5 minutes and up to but not including 60 minute time-frames: 1 month.
Hourly views will have: 3 months.
Daily view: as much data as possible.”
Have I misread your VRT on/off instructions? :–
The code you posted looks the same as mine. Have you tried starting from fresh – import the code from nonetheless’ post and add the robustness test switch code. This will eliminate any chance that you messed up the code somehow with all the // in and out.
BardParticipant
Master
Typed in my IG Index password as “Renko.” I think I might need to take a break from Renko ML algos for a while… 😃
// Conditions to enter long positions
If c1 then
Buy N CONTRACT at renkoMax + boxSize stop
EndIf
// Conditions to enter short positions
If c2 then
Sellshort N CONTRACT at renkoMin - boxSize stop
EndIf
This is what blocks us to have tick by tick 200 000 unité to be replaced by below
// Conditions to enter long positions
If c1 then
Buy N CONTRACT at market
EndIf
// Conditions to enter short positions
If c2 then
Sellshort N CONTRACT at market
EndIf
Doesn’t work for me. Still getting the tbt error warning (tested on DJ daily) with or without While/Wend
The following works for me
Backtested Fifi code above on 100,000 Daily bars … results attached.
Goes back to 1971!
No Tick by Tick warning etc.
EDIT / PS
Same on H4, H1, M15 … No Tick by Tick warning etc.
On M5 … it blows my account .. but that is the values I used! 🙂
but that is the values I used!
Maybe it’s not my values … do you get M1ML1 to make profit Fifi on the 1 min TF?
If Yes can you post results please?
EDIT / PS
M1ML1 takes an insane number of trades with every box size from 5 to 150.
Must not be working correctly??