![]() |
VmaPredict2.js (new) - Printable Version +- Gekko Forum (https://forum.gekko.wizb.it) +-- Forum: Gekko (https://forum.gekko.wizb.it/forum-13.html) +--- Forum: Strategy Development (https://forum.gekko.wizb.it/forum-12.html) +--- Thread: VmaPredict2.js (new) (/thread-58001.html) |
VmaPredict2.js (new) - PGTART - 09-09-2019 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. It can be found here https://github.com/PGTBoos/GekkoStrategies (where you find other strategies from me as well). 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) RE: VmaPredict2.js (new) - anon.e.mous - 09-09-2019 (09-09-2019, 04:02 PM)PGTART Wrote: new strategy based upon volume prediction and moving averages. What are the parameters that you are testing with regarding candle size and warmup? RE: VmaPredict2.js (new) - PGTART - 09-09-2019 (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. 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) RE: VmaPredict2.js (new) - anon.e.mous - 09-10-2019 (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. 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 ). using the default toml configuration: [Swings] Magica = 250 MediumOut = 250 ShortSight = 350 MaxPeekPred = 550 [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? RE: VmaPredict2.js (new) - PGTART - 09-10-2019 (09-10-2019, 09:25 AM)anon.e.mous Wrote:(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. 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 ![]() RE: VmaPredict2.js (new) - anon.e.mous - 09-10-2019 (09-10-2019, 01:59 PM)PGTART Wrote:(09-10-2019, 09:25 AM)anon.e.mous Wrote:(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. 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. RE: VmaPredict2.js (new) - anon.e.mous - 09-10-2019 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. RE: VmaPredict2.js (new) - PGTART - 09-10-2019 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). RE: VmaPredict2.js (new) - PGTART - 09-10-2019 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). RE: VmaPredict2.js (new) - anon.e.mous - 09-10-2019 (09-10-2019, 02:48 PM)PGTART Wrote: Thats almost double of the market good tweaking !!! ![]() 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: { Swings: { Magica: 280, MediumOut: 280, ShortSight: 380, MaxPeekPred: 580, BullsEye: 1000 }, ForcastTrend: { Short: 6, Medium: 17, Long: 100 }, PeriodAverage: { Short: 6, Medium: 25, Long: 100 }, VolumePeriodAverage: { Short: 6, Medium: 30, Long: 100 } } Bear Uptopica Bear MaxpeekPred -533.04 Bear Uptopica Bull ShortSight 1205.13 Bear Uptopica Bull MediumOut 2202.13 Bear Uptopica Bull ShortSight 676.21 Bear Uptopica Bear MaxpeekPred -512.07 Bear Uptopica Bull ShortSight 568.71 Bear Uptopica Bear MaxpeekPred -256.44 Bear Uptopica Bear MaxpeekPred -752.36 Bear Uptopica Bull ShortSight 2345.95 Bear Uptopica Bull MediumOut 1329.31 Bull Magica Bull MediumOut -108.98 Bull Magica Bear MaxpeekPred -348.87 Bear Magica Bear MaxpeekPred -141.67 Bull Magica Bull MediumOut 192.61 Bear Uptopica Bull MediumOut 1456.62 Bear Magica Bear MaxpeekPred -0.36 Bear Magica Bear MaxpeekPred -661.57 Bear Magica Bear MaxpeekPred -454.93 Bear Magica Bull ShortSight 944.39 Bear Uptopica Bear MaxpeekPred -525.19 Bear Uptopica Bull ShortSight 993.36 Bear Uptopica Bear MaxpeekPred -298.83 Bull Magica Bear MaxpeekPred 221.64 Bear Uptopica Bear MaxpeekPred -501.36 Bear Uptopica Bear MaxpeekPred -221.11 Bear profit -4986.160000000002 Bull proffit 11805.439999999999 [b]OUPUT OF THE CODE VERSION THAT YOU HAD RELEASE BEFORE TODAY:[/b] { Swings: { Magica: 280, MediumOut: 280, ShortSight: 380, MaxPeekPred: 580 }, ForcastTrend: { Short: 6, Medium: 17, Long: 100 }, PeriodAverage: { Short: 6, Medium: 25, Long: 100 }, VolumePeriodAverage: { Short: 6, Medium: 30, Long: 100 } } Bear Uptopica Bear MaxpeekPred -337.20 Bear Uptopica Bull ShortSight 1268.23 Bear Uptopica Bull MediumOut 2202.13 Bear Magica Bull ShortSight 1038.72 Bull Magica Bear MaxpeekPred -427.63 Bear Uptopica Bull ShortSight 577.41 Bull Magica <-- POST /api/getCandles Bear MaxpeekPred -252.25 Bear Uptopica --> POST /api/getCandles 200 561ms 240.57kb Bull ShortSight 841.60 Bear Uptopica Bear MaxpeekPred -256.44 Bear Uptopica Bear MaxpeekPred -330.91 Bear Uptopica Bull ShortSight 2530.09 Bull Magica Bull MediumOut 955.93 Bull Magica Bull ShortSight 1087.15 Bull Magica Bear MaxpeekPred -512.59 Bear Magica Bear MaxpeekPred 87.25 Bear Uptopica Bear ShortSight 609.44 Bear Uptopica Bull ShortSight 586.92 Bull Magica Bull MediumOut -108.98 Bull Magica Bear MaxpeekPred -348.87 Bear Uptopica Bear MaxpeekPred -536.28 Bear Magica Bear ShortSight 649.84 Bull Magica Bull MediumOut 192.61 Bear Magica Bull MediumOut 1403.92 Bull Magica Bull MediumOut 634.81 Bull Magica Bear MaxpeekPred -314.33 Bear Uptopica Bear MaxpeekPred -240.55 Bear Magica Bear MaxpeekPred -661.57 Bear Uptopica Bull MediumOut 684.35 Bear Magica Bear MaxpeekPred -454.93 Bear Uptopica Bull ShortSight 883.59 Bull Magica Bear MaxpeekPred -265.62 Bear Uptopica Bear MaxpeekPred -445.56 Bear Uptopica Bull ShortSight 2315.49 Bear Uptopica Bear MaxpeekPred -298.83 Bear Uptopica Bear MaxpeekPred -414.08 Bear Uptopica Bear MaxpeekPred -659.88 Bear Uptopica Bull MediumOut 596.00 Bull Magica Bear MaxpeekPred 221.64 Bear Uptopica Bear MaxpeekPred -291.57 Bear Uptopica Bear MaxpeekPred 798.90 Bear Uptopica Bear profit -4682.020000000004 Bull proffit 17689.969999999994 |