Gamestudio Links
Zorro Links
Newest Posts
rMomentum always returns 0 when checking for peak/valley
by jcl
Today at 17:38
a little help here?
by 3run
Today at 16:38
How to set a pair trading order right
by jcl
Today at 11:46
Dual Momentum Algorithm - The way Zorro would have done it
by Hredot
Today at 05:21
HIgh FRequency Trading Script -- Highly Profitable
by Yosh
Yesterday at 19:27
Linear Regression in objective function
by jcl
11/22/17 15:40
MT4 vs Zorro
by pascalx
11/22/17 14:00
AUM Magazine
Latest Screens
RPG PARTY
Triton Wing now available on Steam
AckCon'17: Lotter vs The World
Triton Wing
Who's Online
14 registered (Lobo, Hredot, painkiller, 3run, alibaba, Kartoffel, FLD, RealSerious3D, Jerome8911, 1 invisible), 169 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
ech87, Lobo, Andy60, AzzoCorp, franzz
17813 Registered Users
Page 3 of 5 < 1 2 3 4 5 >
Topic Options
Rate This Topic
#468891 - 10/25/17 21:50 Re: BitTrex Plugin (Crypto Trading) [Re: JohanAu]
vinsom Offline
Junior Member

Registered: 11/01/16
Posts: 73
Loc: NSW
Start to write some crypto strategies guys..
Use Zorro 171 beta.
In attachment there is a script to download 60 minuted history from CryptoCompare. You will need the CryptoCompareHistoryAPI exe and dependencies in your zorro folder.
Put your symbols in your asset list that you want to download.
See sample in BitTrex plugin readme.
Then start with the simplest strategy on 60 min bars like the one below from the manual with few changes.

Enjoy.
Vincenzo


function run()
{
set(TESTNOW+LOGFILE);
set(PRELOAD);
StartDate = 2015;
BarPeriod = 60;
//NumYears=1;
//StartDate = 20140718;
//EndDate = 20170522; // fixed simulation period
Margin=1;
//Capital=10000;
vars MMI_Raw;
vars MMI_Smooth;

assetList("AssetsCoinsBitTrexStrategy.csv");
while (asset(loop(Assets)))
{


vars Price = series(price());
vars Volume = series(marketVol ());
vars Trend = series(LowPass(Price,50));//500

Stop = 4*ATR(25);

MMI_Raw = series(MMI(Price,30));//300
MMI_Smooth = series(LowPass(MMI_Raw,50));//500

if(falling(MMI_Smooth)) {
if(valley(Trend) && rising(Volume))
enterLong();
else if(peak(Trend))
exitLong();

}


}

set(LOGFILE); // log all trades
PlotWidth = 800;
PlotHeight1 = 300;
plot("MMI_Raw",MMI_Raw,NEW,GREY);
plot("MMI_Smooth",MMI_Smooth,0,BLACK);
//plotTradeProfile(-50);
}


Attachments
DownloadCoinsBittrex_SHARE.c (24 downloads)


Top
#469284 - 11/10/17 11:03 Re: BitTrex Plugin (Crypto Trading) [Re: vinsom]
Cheulmen Offline
Newbie

Registered: 11/09/17
Posts: 19
@vinsom I'm trying to use your code, but the authentication to BitTrex with the API is giving me an error. It says APIkey invalid, but I've re-checked the API keys and they're ok. Just to be sure that I'm doing things correctly:

1.- It seems that you've named "PublicKey" to a variable that actually is the Secret (in the BitTrex nomenclature). Is this correct?

2.- The configuration of Bittrex should be put in the zorro.ini file, just after (in the default zorro.ini file) AVApiKey variable.

3.- The username and password of BitTrex are not needed because your code use the API keys inside zorro.ini to connect, and the 111111 is just a random number and it doesn't needs to be modified, right?

I can't wait to use this code for crypto laugh

Top
#469306 - 11/10/17 18:05 Re: BitTrex Plugin (Crypto Trading) [Re: vinsom]
Nanitek Offline
Senior Member

Registered: 03/25/15
Posts: 327
Loc: Rogaland
Originally Posted By: vinsom

You will need the CryptoCompareHistoryAPI exe and dependencies in your zorro folder.


Where can I get that?

Top
#469307 - 11/10/17 18:24 Re: BitTrex Plugin (Crypto Trading) [Re: Nanitek]
Cheulmen Offline
Newbie

Registered: 11/09/17
Posts: 19
@Nanitek, you can download it from the vinsom github. It happened also to me, I wasn't able to find it laugh Here is it: https://github.com/vinsom68/CryptoCompareHistoryAPI

Top
#469346 - 11/12/17 00:09 Re: BitTrex Plugin (Crypto Trading) [Re: Cheulmen]
Nanitek Offline
Senior Member

Registered: 03/25/15
Posts: 327
Loc: Rogaland
Originally Posted By: Cheulmen
@Nanitek, you can download it from the vinsom github. It happened also to me, I wasn't able to find it laugh Here is it: https://github.com/vinsom68/CryptoCompareHistoryAPI


thx

I have installed the .net but where do the files need to be copied exactly?

Top
#469349 - 11/12/17 00:59 Re: BitTrex Plugin (Crypto Trading) [Re: Nanitek]
Cheulmen Offline
Newbie

Registered: 11/09/17
Posts: 19
Go here: https://github.com/vinsom68/CryptoCompareHistoryAPI/tree/master/LatestBuild

And copy all of those files in your Zorro folder; in my case it is C:/users/Administrator/Zorro

Top
#469356 - 11/12/17 11:18 Re: BitTrex Plugin (Crypto Trading) [Re: Cheulmen]
vinsom Offline
Junior Member

Registered: 11/01/16
Posts: 73
Loc: NSW
Hi,
You should get 2 keys from Bittrex when you change the Bittrex settings and ask for API trading.
The secret one is the private key, the other one is the public.
Yes 1111 is a random number, you don't need your user and pwd to login. API keys are enough
Hope this helps

PrivateKey = "????????????????????"
PublicKey = "??????????????????????"

Top
#469363 - 11/12/17 18:42 Re: BitTrex Plugin (Crypto Trading) [Re: vinsom]
Cheulmen Offline
Newbie

Registered: 11/09/17
Posts: 19
Ok, I had the keys exchanged. Now it connects laugh

Top
#469374 - 11/13/17 15:26 Re: BitTrex Plugin (Crypto Trading) [Re: Cheulmen]
JohanAu Offline
Newbie

Registered: 09/24/16
Posts: 17
Loc: France
Hello Vinsom,

PipCost is constantly varying due to BTC fluctuation, consequently the LotAmount is varying as well.

When you buy 1 lot of an asset and then you sell 1 lot of the very same asset : the quantity you sell can be different from the quantity bought in the first place. The profit calculation is then incorrect.

I am wondering if you have workaround for that ? I was thinking of fixing the PIPCost at the first init of the function.

Thanks !

Johan

Top
#469380 - 11/13/17 20:07 Re: BitTrex Plugin (Crypto Trading) [Re: JohanAu]
vinsom Offline
Junior Member

Registered: 11/01/16
Posts: 73
Loc: NSW
Hi JohanAu.
In regards to this issue, the Pipcost should be constant until you stop and restart a strategy when trading live.
I remember I specifically faced this issue when testing the plugin, and the solution I applied was to lock in the the reference exchange rate for the pip cost calculation when the plugin is loaded.
So if you don't restart the strategy the pip cost should be constant.

If you are still facing issue please post your zorro.ini configuration (without the keys) and the asset list you are using and I'll have a look at it.

You can lock in the pipcost in your strategy as a temporary work around until I fix it if this is still a plugin issue.

Cheers
Vince

Top
Page 3 of 5 < 1 2 3 4 5 >



Gamestudio download | chip programmers | Zorro platform | shop | resources | magazine | manual | support faq | bugs

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) 3dgamestudio.net