CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 66 % of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.

{DARWIN API} Backtesting tool by naturalcapital

Thank you @naturalcapital for this update and some insights :grin:

3 Likes

Impressive work :darwinex:!!

5 Likes

I suggest that Darwinex begins to award Golden Owls :darwinex: to members :joy::grin: !

5 Likes

I’ve thought of an incentive for clients sharing tools of their creation instead of keeping to themselves, also reward forum top40 posters, much like “CommunityIA”. Oh, it’s going to be a little modest one (solo endeavour) when I find time.

2 Likes

https://community.darwinex.com/u?period=all

It is a long way to the top…
:wink:

3 Likes

Yeah, figured it out (my initial judgement increased from top15/25 to top40 for this reason). I lost some count along the way myself :wink: Also, part of the places held belong to the staff already. To make it more even, a “monthly” ranking could be considered on top of “all time”, both leading to “prizes”. Anyway, something around the most “liked” posters seem like a good idea.

edit: instead of top40, it’s looking like appearing on the 1st page of ranking would be a good fit for easiness since there is no “places sorting”. It equals to Top50.
Maybe all-time Top50 Likes received + Top25 likes sent ? to encourage peeps to be nice and productive.

1 Like

2 Likes

You just made my weekend @naturalcapital

THANK YOU

9 Likes

2 Likes

This picture is the thumbnail in the weekly emails :joy: :joy:

2 Likes

Speeding up 20x the arithmetics in R with data.table syntaxis :v: :sweat_smile:

> str(darwins.daily.data)
Classes ‘data.table’ and 'data.frame':	1096542 obs. of  17 variables:
 $ tstamp   : Date, format: "2017-04-03" "2017-04-04" ...
 $ symbol   : chr  "AAE.4.6" "AAE.4.6" "AAE.4.6" "AAE.4.6" ...
 $ quotes   : num  95.1 95.2 95.2 95.4 95.8 ...
 $ D.Periods: num  4.8 4.81 4.81 4.81 4.81 ...
 $ Ex       : num  4 4.01 4.01 4.01 4.01 ...
 $ Mc       : num  9.78 9.78 9.78 9.78 9.78 ...
 $ Rs       : num  0.931 0.941 0.95 0.96 0.971 ...
 $ Ra       : num  8.79 8.8 8.8 8.8 8.81 ...
 $ Os       : num  9.47 9.47 9.46 9.46 9.46 ...
 $ Cs       : num  9.62 9.62 9.62 9.62 9.63 ...
 $ R.       : num  8.5 8.44 8.41 8.38 8.27 ...
 $ R..1     : num  9.01 9.01 9.01 9.01 9 ...
 $ Dc       : num  6.57 6.56 6.56 6.55 6.51 ...
 $ La       : num  0.439 0.44 0.44 0.439 0.44 ...
 $ Pf       : num  4.26 4.29 4.29 4.33 4.41 ...
 $ Cp       : num  6.64 6.64 6.63 6.58 6.54 ...
 $ D.Score  : num  20.8 20.9 20.9 21 21.1 ...
 - attr(*, ".internal.selfref")=<externalptr> 
 - attr(*, "index")= int 
  ..- attr(*, "__symbol")= int 
> 
> x <- darwins.daily.data
> 
> system.time(
+   
+   x <- split(x,x$symbol) %>% lapply(function(x){
+     
+     x$Returns <- x$quotes/lag(x$quotes,1)-1
+     x$WeekRetruns <- x$quotes/lag(x$quotes,5)-1
+     x$MonthReturns <- x$quotes/lag(x$quotes,20)-1
+     x$leadReturns <- lead(x$quotes,1)/x$quotes-1
+     x$leadWeekReturns <- lead(x$quotes,5)/x$quotes-1
+     x$leadMonthReturns <- lead(x$quotes,20)/x$quotes-1
+     x
+     
+   }) %>% rbindlist()
+   
+ )
   user  system elapsed 
  7.489   0.039   7.576 
> 
> x <- darwins.daily.data
> 
> system.time(
+   
+   x[,
+     `:=` (
+       Returns = quotes/lag(quotes,1)-1,
+       WeekReturns = quotes/lag(quotes,5)-1,
+       MonthReturns = quotes/lag(quotes,20)-1,
+       leadReturns = lead(quotes,1)/quotes-1,
+       leadWeekReturns = lead(quotes,5)/quotes-1,
+       leadMonthReturns = lead(quotes,20)/quotes-1
+     ),
+     symbol]
+   
+ )
   user  system elapsed 
  0.391   0.000   0.392 
> 

Just joy, and other little step

4 Likes

R’s data.table r0x0r :muscle: :nerd:

2 Likes

Well done @naturalcapital !

1 Like

Hello, looks great but the webpage doesn’t load. I tried from diffrent devices from diffrent internet connexions, still timeout :frowning:

Hello @totolino,

Could you share some information about your error (URL / screenshot / etc.) ? I can confirm that website loads correctly.

Sincerely,

1 Like

Tried again, it works, was just super slow to load.

Thanks

2 Likes

I think you just might have tried to access while someone else was playing around. If my understanding of how this tool functions is correct, users have to wait for each other while using it, because unfortunately, shiny does not support concurrent access.

2 Likes

Hey! Thanks for warning @totolino I tried and It didn’t wor for me neither, seems to be related to the noip service. It is a free account and maybe it expired, but it’s strange because i created it less than 30 days ago. The host disappeared from my main page, and if I try to create it again I recive an error saying that it currently exists. So erratic.
Now is working again but I can’t trust that it will be working tomorrow so I created a secondary host name on ncap.myvnc.com

2 Likes

Hello
It’s working much better now. Thanks @naturalcapital

1 Like

I added your mirror link at the depot.