Gekko Forum
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)

Pages: 1 2 3 4 5 6 7 8 9


RE: VmaPredict2.js (new) - QueefWellington - 09-16-2019

(09-16-2019, 06:30 PM)PGTART Wrote:
(09-16-2019, 06:08 PM)QueefWellington Wrote:
(09-16-2019, 06:04 PM)PGTART Wrote:
(09-16-2019, 05:48 PM)QueefWellington Wrote: Just having a look at this.

Correct me if I'm wrong but magica is used to compare with the actual close price right? So your default magica value of 380 is of whatever currency you are trading? This means that those values will have to be drastically different for another currency pair. Also if you ran the bot for a long time, your magica value might be good at the start but after a couple of months, it will no longer be optimal because the price could me much high/lower.

It may be better to do these as percentages of the actual price rather than absolute values. That way the effectiveness of the value won't change over time and can be applied to other pairs.

But apart from that, it looks good Smile

Percentages is the next future plan v7 or v8, any way soon, its easier for debugging to use fixed amounts.
But it will come  for sure

Sounds good pal. Just adding percentages in myself now because It's easier than setting values like 0.00001 Big Grin

Do you prefer trading on long average percentages or based upon current candle?
I kinda wonder if current candle might influence to much.

I've only ever used current candle for percentages. But smoothing it out with like 5 candles sounds like a good idea. Never thought of it.


RE: VmaPredict2.js (new) - anon.e.mous - 09-17-2019

(09-16-2019, 04:35 PM)PGTART Wrote: I think for shorter time ranges
The red values are based on trade profits losses so those might require to be a bit smaller :
The green values are used in averaging, so say 20  minute trades, if one does the averages x3 (then they still contain a hour of data).
It should be possible i think there is nothing limiting this math not to work on other time ranges.
And if it works for one range it should thus also work on another range (math is universal), but it will have different tweak settings.

ea Magica moments might be a bit smaller because in smaller timeranges the gain profit (per candle) is statistically smaller as compared to one hour profit  (however since more candle's pass by there is a chance to take more opertunities in the 5 min range).

sorry for my typo of using # instead of // on top of the js file   (misstake used toml style comment).

TOML:

[Swings]  # where is store my own constants

# magica       = used in long buy price dips
# mediumout = used in short sell
# shortsight   = used in short sell

Magica = 325
MediumOut = 280
ShortSight = 400

# downhill = short after price drop since highest
# highshot = short after price jump 2 new candles
# bullseye = secure profit since bought
# daystop = max los stops trade till next day

DownHill = 250 
HighShot = 290  
BullsEye = 1000    
DayStop = 300     



[ForcastTrend] 
#forcast trend tulip indicator

Short =  6 
Medium = 12
Long = 100   #nan


[PeriodAverage] 
#moving averages
Short = 6 
Medium = 25
Long = 100

[VolumePeriodAverage]
 #volume moving averages  

Short  = 6    #not used
Medium = 30  
Long   = 100  #not used


This resulted in 
simulated profit: 258.50833%
When market was 172.74404%

I was trying to test with smaller candles (1 and 5 min) but never found a way to have a positive result. Need to test more.

I know the values must be smaller. The TOML configurations that I've posted are for 1 hour candles only. But since this variables are based in value and not in percentage it is difficult to find the sweet spot.


RE: VmaPredict2.js (new) - PGTART - 09-17-2019

Update I decided to release an intermedium version 6B

6B can still behave like 6
However, as i don't wanted this version to fragment in other forked versions here.
So I decided to release a version that can handle percentages, earlier before the other future's i have planed

Magica, MediumOut, ShortSight, and HighShot as well.
Can now use a percentage with a new toml and code file, in the toml I have now the option:    UsePercentage = true 
If set to true then those 4 variables take a percentage of the long moving average  (which makes most sense I believe, in the kind of math i use).
In this case 100% equals 1, so for example 5% equals 0.05  (But since BTC is so high maybe you like to test 0.005 .. percetage as a fraction.

if you set:  UsePercentage = false
Then the old behavior is used, using fixed constants

From you i requesting how this works out, (post your results and toml settings, so that i can improve it more).
Might be interesting for alt markets i think, and i have not tested it on that so far, so i am curious how it behaves in low priced coins.

You'll find 6B version here : https://github.com/PGTBoos/GekkoStrategies


I release it a bit early as, wel tomorrow I start at a new job so (I coded this while i had no job).
After today new release will appear less frequent, i will not have that much time left then.
So a neural network improved version 20 is not to be realeased anytime soon now (one day i will use tensor flow) with js.

An important note though, I really depend on you people testing this out.
Doing coding and good market testing takes a lot of time, and doing it all would reduce my coding speed a lot.
I rather focus on math, statistics coding, algorithmic trading, so please, please please...
So share your result, so I can improve upon it, and others might improve upon you as well.
I spend about a week coding this for free, so don't hesitate to join the development of code by testing it.


RE: VmaPredict2.js (new) - QueefWellington - 09-17-2019

(09-17-2019, 02:01 PM)PGTART Wrote: [size=large][color=#993399]

Magica, MediumOut, ShortSight, and HighShot as well.
Can now use a percentage with a new toml and code file, in the toml I have now the option:    [b]UsePercentage = true
 
If set to true then those 4 variables take a percentage of the long moving average  (which makes most sense I believe, in the kind of math i use).
In this case 100% equals 1, so for example 5% equals 0.05  (But since BTC is so high maybe you like to test 0.005 .. percetage as a fraction.

So what is it a percentage of? So when you say "100% = 1" 1 what?

Wouldn't it make more sense for it to be the actual percentage of the price? So for example if you set it to 10 it's 10% of the price?


RE: VmaPredict2.js (new) - PGTART - 09-17-2019

(09-17-2019, 07:12 PM)QueefWellington Wrote:
(09-17-2019, 02:01 PM)PGTART Wrote: [size=large][color=#993399]

Magica, MediumOut, ShortSight, and HighShot as well.
Can now use a percentage with a new toml and code file, in the toml I have now the option:    [b]UsePercentage = true
 
If set to true then those 4 variables take a percentage of the long moving average  (which makes most sense I believe, in the kind of math i use).
In this case 100% equals 1, so for example 5% equals 0.05  (But since BTC is so high maybe you like to test 0.005 .. percetage as a fraction.
[/b]


So what is it a percentage of? So when you say "100% = 1" 1 what?

Wouldn't it make more sense for it to be the actual percentage of the price? So for example if you set it to 10 it's 10% of the price?

100% = 1
25% = 0.25
1% =0.01

I've always found it easier to use percentages this way..it is a percentage of the long moving average.
The long moving average is the average price of a coin over x days its under PeriodAverage  in the toml file
So its not the current candle (thats not ideal for my math, that tries to find anomalies).


RE: VmaPredict2.js (new) - QueefWellington - 09-17-2019

(09-17-2019, 08:11 PM)PGTART Wrote:
(09-17-2019, 07:12 PM)QueefWellington Wrote:
(09-17-2019, 02:01 PM)PGTART Wrote: [size=large][color=#993399]

Magica, MediumOut, ShortSight, and HighShot as well.
Can now use a percentage with a new toml and code file, in the toml I have now the option:    [b]UsePercentage = true
 
If set to true then those 4 variables take a percentage of the long moving average  (which makes most sense I believe, in the kind of math i use).
In this case 100% equals 1, so for example 5% equals 0.05  (But since BTC is so high maybe you like to test 0.005 .. percetage as a fraction.
[/b]


So what is it a percentage of? So when you say "100% = 1" 1 what?

Wouldn't it make more sense for it to be the actual percentage of the price? So for example if you set it to 10 it's 10% of the price?

100% = 1
25% = 0.25
1% =0.01

I've always found it easier to use percentages this way..it is a percentage of the long moving average.
The long moving average is the average price of a coin over x days its under PeriodAverage  in the toml file
So its not the current candle (thats not ideal for my math, that tries to find anomalies).

So if you wanted to set magica to 10% of the long ma you would set magica to 0.1 in toml? Your code then does:
this.Toml.Magica = this.settings.Swings.Magica * maLong;

I might be being pedantic, but isn't that a fraction?


RE: VmaPredict2.js (new) - PGTART - 09-17-2019

Uh Oh i Its candy day !!!, found a small typo bug in 6B, so I  released 6C !!
And because its candy day it has a new rule as well !
Oh well had it in the back of my mind for a while, and wanted to see how you people might make use of it.
Its in the Toml under RSISafety.

RSI safety is intended to get out earlier before (a deep  downhill fall happens).
Idealy negative Downhills are to be avoided (but some will happen, there will be times of losses as well).
A simple typical RSI trader would for example sell based upon RSI >70%   (thats 0.7 in the toml).
This new RSISafety is a short protection, and will sell if RSISHort > 0.xx 
However it will not trigger if the current candle is below the price we bought the last time.
Thus theoretically it should be possitive, but there is always the uncertanty of the future..)
only the DownHill rule will sell (by a statical predicted next candle) below  the bought price, intended to minimize loozes.

The way the Magica rule works, made it also buying on flat side trend markets (often falling low later).
I was quite a while looking for a way around it, Magica is still the same rule
But it has extended logica now, it will not buy based upon the toml tresholt RSIWait, if RSI is higher no buy is done.
for example if you want it to act on < 50%   (then RSIWait = 0.5 in the toml) Magica wont buy, if the rsi is value above RSIWait (buy protection).
RSIcandles is just the standard over how many candles RSI is calculated.
RSI traders often use values as 20% or 50%, 70% or so, but I do not use soley RSI to trade, i use it for protection only.
So now the Magica rule has some protection of the RSI indicator (besides its other complex logica) (dont about the other logic that answer is in the code).

The provided TOML for 6C is not at all optimal, and I await you people's results.
The TOML is just what i used in debugging and validating the code and math.


Ideally HighShot and RSIShort might together scalp short small waves, resulting in a Magica buy next

I do realize its not a simple strategy with a few TOML variables, sorry for that.
Please also understand that logic improvements require your testing results to be posted here as well.


Note if RSIShort sell does not workout  (there is a chance for that, set it to 2 or so), (might inflict with highshot wrongly also). i'm awaiting your results
Also RSIWait can be set to 2 to disable it (so you can first fine tune al other settings before you tryout that RSI protection).


RE: VmaPredict2.js (new) - ortu - 09-20-2019

No trades for me in backtest.....any idea?


RE: VmaPredict2.js (new) - PGTART - 09-20-2019

(09-20-2019, 08:35 AM)ortu Wrote: No trades for me in backtest.....any idea?
Alter the toml file it was not optimized I await testers here to do that


RE: VmaPredict2.js (new) - trackers - 09-22-2019

FYI there's a spelling mistake in 6B - 'malong' instead of 'maLong' on line 277