09-09-2019, 04:02 PM (This post was last modified: 09-12-2019, 08:38 PM by PGTART.)
Its a new strategy based upon volume prediction and moving averages.
Still tweaking it around, it started with reasonable profit chances.
Continous tweeking and I got to version 5 (and more), at which under the right settings high profits where made.
By now the code base has grown large over 300 lines, while simple to maintain and to extend.
You free to use or test it, however in return i'd like you to post the settings file (and what you where trading) in return here
Let me now your tweaking results or code alterations, your highest scores.
Because i cannot code and test at the same time.
Also I like to point out that it logs to console
And the code base is realy handy to use as a template.
Its a code template i will stick too
A default TOML is included as well for every version.
Once a version is made i dont extend it, some version behave different so you can get different results with each version.
One might stick to a certain version, or use the latest version. (generally speaking later is often better).
(the strategy may require a bit longer time I testedit against 2 and 7 months)
(09-09-2019, 04:02 PM)PGTART Wrote: new strategy based upon volume prediction and moving averages.
still tweaking it around, can do quite good to average ,but also loose a bit, overall its not a bad looser, reasonable above average
(09-09-2019, 04:02 PM)PGTART Wrote: new strategy based upon volume prediction and moving averages.
still tweaking it around, can do quite good to average ,but also loose a bit, overall its not a bad looser, reasonable above average
Let me now your tweaking results or code alterations
Also I like to point out it has nice console log, and its realy handy to use as a template.
Its a code template i will stick too
a default TOML is included as well.
What are the parameters that you are testing with regarding candle size and warmup?
I Used 1 hour setting 10 hour warmup (one can use longer warmup equal to largest medium length since long periods where not used)
With some tweaking other periods and settings can make profit as well, i personally found it difficult with 5 minute ranges.
tweaking for 30 wouldnt take long just test it.
In general this could do slightly better then the market, i think.
It tries to find lower then averages to buy and higher then to sell, most of the times it works, but misstakes happen and can reduce profit.
At somepoint I made the BullsEye rule (take 1000 profit if it estimates it might becomme), it doesnt hurt it also allows for more trades.
For tweaking watch the console output none of the rules should dominate the output, some will be rarely though but it should be mixed.
Each rule has a certain chance to ocure and to make profit or take a loss. MaxPeekPred often makes a loss (but not always), but it allows for trading as well. (its not a hodl stoploss)
09-10-2019, 09:25 AM (This post was last modified: 09-10-2019, 11:02 AM by anon.e.mous.)
(09-09-2019, 10:46 PM)PGTART Wrote:
(09-09-2019, 04:34 PM)anon.e.mous Wrote:
(09-09-2019, 04:02 PM)PGTART Wrote: new strategy based upon volume prediction and moving averages.
still tweaking it around, can do quite good to average ,but also loose a bit, overall its not a bad looser, reasonable above average
Let me now your tweaking results or code alterations
Also I like to point out it has nice console log, and its realy handy to use as a template.
Its a code template i will stick too
a default TOML is included as well.
What are the parameters that you are testing with regarding candle size and warmup?
I Used 1 hour setting 10 hour warmup (one can use longer warmup equal to largest medium length since long periods where not used)
With some tweaking other periods and settings can make profit as well, i personally found it difficult with 5 minute ranges.
tweaking for 30 wouldnt take long just test it.
In general this could do slightly better then the market, i think.
It tries to find lower then averages to buy and higher then to sell, most of the times it works, but misstakes happen and can reduce profit.
At somepoint I made the BullsEye rule (take 1000 profit if it estimates it might becomme), it doesnt hurt it also allows for more trades.
For tweaking watch the console output none of the rules should dominate the output, some will be rarely though but it should be mixed.
Each rule has a certain chance to ocure and to make profit or take a loss. MaxPeekPred often makes a loss (but not always), but it allows for trading as well. (its not a hodl stoploss)
First, thanks for you prompt answer
I can confirm your observations, I've tested with candles below 1 hour and the results are always loss. With 1 day candles it tends to get better, but i see that in a Bear market it will loose a lot, draining the profits made in the Bull market.
I'm using a time-frame for the past August (FROM: 2019-07-30 18:00 TO: 2019-08-31 23:59) with 1 day candles and 30 for warmup, which is the longest medium value ([VolumePeriodAverage] Medium = 30 ).
(09-09-2019, 04:02 PM)PGTART Wrote: new strategy based upon volume prediction and moving averages.
still tweaking it around, can do quite good to average ,but also loose a bit, overall its not a bad looser, reasonable above average
Let me now your tweaking results or code alterations
Also I like to point out it has nice console log, and its realy handy to use as a template.
Its a code template i will stick too
a default TOML is included as well.
What are the parameters that you are testing with regarding candle size and warmup?
I Used 1 hour setting 10 hour warmup (one can use longer warmup equal to largest medium length since long periods where not used)
With some tweaking other periods and settings can make profit as well, i personally found it difficult with 5 minute ranges.
tweaking for 30 wouldnt take long just test it.
In general this could do slightly better then the market, i think.
It tries to find lower then averages to buy and higher then to sell, most of the times it works, but misstakes happen and can reduce profit.
At somepoint I made the BullsEye rule (take 1000 profit if it estimates it might becomme), it doesnt hurt it also allows for more trades.
For tweaking watch the console output none of the rules should dominate the output, some will be rarely though but it should be mixed.
Each rule has a certain chance to ocure and to make profit or take a loss. MaxPeekPred often makes a loss (but not always), but it allows for trading as well. (its not a hodl stoploss)
First, thanks for you prompt answer
I can confirm your observations, I've tested with candles below 1 hour and the results are always loss. With 1 day candles it tends to get better, but i see that in a Bear market it will loose a lot, draining the profits made in the Bull market.
I'm using a time-frame for the past August (FROM: 2019-07-30 18:00 TO: 2019-08-31 23:59) with 1 day candles and 30 for warmup, which is the longest medium value ([VolumePeriodAverage] Medium = 30 ).
[ForcastTrend]
Short = 6
Medium = 17
Long = 100 #nan
[PeriodAverage]
Short = 6
Medium = 25
Long = 100 #nan
[VolumePeriodAverage]
Short = 6 #nan
Medium = 30
Long = 100 #nan
Should I use a longer time frame? 2, 3 months?
I'm getting the following results in the attached image.
Also I have a question about this values:
Magica = 150
MediumOut = 150
ShortSight = 250
MaxPeekPred = 350
What do they stand for?
While writing an answer i noted a imperfection at the code idea, so at my github there is new code (also a new toml )
code is here : https://github.com/PGTBoos/GekkoStrategies
I recomend you to install visual studio Code (available on linux and windows), its a good code editor. (and not as heavy a visual studio)
I have added more comments in the code, and altered the rules slightly.
The first Magica is used in finding buy moments (its a alternative to the default)
The others are used in the going short math, to decide when to sell.
They are tweakable, and you can check them out.
One is easy to explain, is MaxPeekPred it goes short when it predicts the price will drop "this amount" since the last high.
New is BullsEye kind of the oposite it goes short after a (huge) gain since coins where bought, i recomend to set it high like 1000 or so
The others are a bit bit more complex to explain, but becomme more clear when you read to code. (which is now better commented)
I tested with 2 and 7 month and 1 hour periods on Biance with a gekko simulation
Especially the SwingsVar might require tweening when the time scales are altered.
I wish to make it less dependant on time scales, but thats another open question here at the forum.
shown below it got 141% out of a 93% market, it might not be always like this but just showing it can be possitive
(09-09-2019, 04:02 PM)PGTART Wrote: new strategy based upon volume prediction and moving averages.
still tweaking it around, can do quite good to average ,but also loose a bit, overall its not a bad looser, reasonable above average
Let me now your tweaking results or code alterations
Also I like to point out it has nice console log, and its realy handy to use as a template.
Its a code template i will stick too
a default TOML is included as well.
What are the parameters that you are testing with regarding candle size and warmup?
I Used 1 hour setting 10 hour warmup (one can use longer warmup equal to largest medium length since long periods where not used)
With some tweaking other periods and settings can make profit as well, i personally found it difficult with 5 minute ranges.
tweaking for 30 wouldnt take long just test it.
In general this could do slightly better then the market, i think.
It tries to find lower then averages to buy and higher then to sell, most of the times it works, but misstakes happen and can reduce profit.
At somepoint I made the BullsEye rule (take 1000 profit if it estimates it might becomme), it doesnt hurt it also allows for more trades.
For tweaking watch the console output none of the rules should dominate the output, some will be rarely though but it should be mixed.
Each rule has a certain chance to ocure and to make profit or take a loss. MaxPeekPred often makes a loss (but not always), but it allows for trading as well. (its not a hodl stoploss)
First, thanks for you prompt answer
I can confirm your observations, I've tested with candles below 1 hour and the results are always loss. With 1 day candles it tends to get better, but i see that in a Bear market it will loose a lot, draining the profits made in the Bull market.
I'm using a time-frame for the past August (FROM: 2019-07-30 18:00 TO: 2019-08-31 23:59) with 1 day candles and 30 for warmup, which is the longest medium value ([VolumePeriodAverage] Medium = 30 ).
[ForcastTrend]
Short = 6
Medium = 17
Long = 100 #nan
[PeriodAverage]
Short = 6
Medium = 25
Long = 100 #nan
[VolumePeriodAverage]
Short = 6 #nan
Medium = 30
Long = 100 #nan
Should I use a longer time frame? 2, 3 months?
I'm getting the following results in the attached image.
Also I have a question about this values:
Magica = 150
MediumOut = 150
ShortSight = 250
MaxPeekPred = 350
What do they stand for?
While writing an answer i noted a imperfection at the code idea, so at my github there is new code (also a new toml )
code is here : https://github.com/PGTBoos/GekkoStrategies
I recomend you to install visual studio Code (available on linux and windows), its a good code editor. (and not as heavy a visual studio)
I have added more comments in the code, and altered the rules slightly.
The first Magica is used in finding buy moments (its a alternative to the default)
The others are used in the going short math, to decide when to sell.
They are tweakable, and you can check them out.
One is easy to explain, is MaxPeekPred it goes short when it predicts the price will drop "this amount" since the last high.
New is BullsEye kind of the oposite it goes short after a (huge) gain since coins where bought, i recomend to set it high like 1000 or so
The others are a bit bit more complex to explain, but becomme more clear when you read to code. (which is now better commented)
I tested with 2 and 7 month and 1 hour periods on Biance with a gekko simulation
Especially the SwingsVar might require tweening when the time scales are altered.
I wish to make it less dependant on time scales, but thats another open question here at the forum.
shown below it got 141% out of a 93% market, it might not be always like this but just showing it can be possitive
Thanks for taking the time to answer my questions. I've been tweaking the value in the "old" version and got very good results for BTC/EUR on GDAX for a time-frame from 01/01/2019 until today.
The results are below:
I'll now download the new version and do some comparison tests.
Thanks for sharing you hard work with the community.
well, installed the new version and done some comparison testing against the "old" version.
TIME-FRAME:
FROM: 2019-01-01 00:00
TO: 2019-09-10 14:15
CANDLE SIZE: 1 hour
WARMUP: 30
OLD VERSION TOML:
[Swings]
Magica = 280
MediumOut = 280
ShortSight = 380
MaxPeekPred = 580
[ForcastTrend]
Short = 6
Medium = 17
Long = 100 #nan
[PeriodAverage]
Short = 6
Medium = 25
Long = 100 #nan
[VolumePeriodAverage]
Short = 6 #nan
Medium = 30
Long = 100 #nan
NEW VERSION TOML:
[Swings]
Magica = 280 # used in buy price dips
MediumOut = 280 #
ShortSight = 380 #
MaxPeekPred = 580 # short to go out of deep falls based on last peek difference prediction
BullsEye = 60000 # Since we are taking very long positions and BTC tends to have huge variation this was set to a high value so it doesn't trigger this condition
[ForcastTrend] #forcast trend tulip indicator
Short = 6
Medium = 17
Long = 100 #nan
[PeriodAverage] #moving averages
Short = 6
Medium = 25
Long = 100
[VolumePeriodAverage] #volume moving averages
Short = 6 #nan
Medium = 30
Long = 100 #nan
OLD VERSION BACKTEST RESULTS:
NEW VERSION BACKTEST RESULTS:
using the same configuration the new version performs below the old version in the same time-frame and with the same candle size.
If the candle size is reduced to 30 min, we have the same kind of results. Older version outperforms the new version.
OLD VERSION: market 169.84227% simulated profit 174.22247%
NEW VERSION: market 169.84227% simulated profit 74.23887%
I don´t have the skills to understand the code, but whatever logic was changed in the new version is making it under-perform.
Thats almost double of the market good tweaking !!!
I see it got especially well through the bear markets, that's for me the hardest part to code.
I'm curious how the new code will behave on it, and what settings you used.
If you share it then I might get some insights and better be able to nail the bear market in code.
Perhaps also include the console log (i'm a creative thinker so i use colors to think about statiscal strategies)
Oh notice that the new BullsEye value was in the past hard coded at 1000 (its a new toml setting).
I'm still actively coding till I start at my new job, in about 9 days.
What i would like to create is a good 5 minute strategy,
As mainly because it would be less boring to look at it.
And it should potentially have more profit (as there are more price swings in short regions).
I would like to create a small room display next to my thermostat, a trading stat
I also will release a candle stick trader soonish, (but it should perform a bit beter first).
BTW on Github i now have also the original version you used with the BullsEye addition.
I putted it in, as it kinda secures a gain, and higher profits come from finding all time lows in market price by trading frequently.
Though i'm also starting to doubt it, maybe it should trigger slightly different
so after xxxxx profit gain at the moment of short average down turn points.. bearish or side markets.. (i need a good indicator for side markets).
(09-10-2019, 02:48 PM)PGTART Wrote: Thats almost double of the market good tweaking !!!
I see it got especially well through the bear markets, that's for me the hardest part to code.
I'm curious how the new code will behave on it, and what settings you used.
If you share it then I might get some insights and better be able to nail the bear market in code.
Perhaps also include the console log (i'm a creative thinker so i use colors to think about statiscal strategies)
Oh notice that the new BullsEye value was in the past hard coded at 1000 (its a new toml setting).
I'm still actively coding till I start at my new job, in about 9 days.
What i would like to create is a good 5 minute strategy,
As mainly because it would be less boring to look at it.
And it should potentially have more profit (as there are more price swings in short regions).
I would like to create a small room display next to my thermostat, a trading stat
I also will release a candle stick trader soonish, (but it should perform a bit beter first).
I didn't change anything in your code. When I refer to new and old are your versions, being the first version of your code the OLD and the version that you've released today the NEW.
The only thing that i change were values in the toml, which you can see in the posts above. The changes that you published today make the stategie with the same configuration on the TOML to performe worst than you older version of the code.
Using the TOML configuration that i've posted above the console log output is the following:
OUPUT OF THE CODE VERSION THAT YOU'VE RELEASE TODAY WHICH PERFORMS BELOW THE OLDER VERSION: