Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, monk12, Quad), 829 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 7 1 2 3 4 5 6 7
Re: BitTrex Plugin (Crypto Trading) [Re: JohanAu] #468891
10/25/17 19:50
10/25/17 19:50
Joined: Nov 2016
Posts: 103
NSW
V
vinsom Offline OP
Member
vinsom  Offline OP
Member
V

Joined: Nov 2016
Posts: 103
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);
}

Attached Files
Re: BitTrex Plugin (Crypto Trading) [Re: vinsom] #469284
11/10/17 10:03
11/10/17 10:03
Joined: Nov 2017
Posts: 34
C
Cheulmen Offline
Newbie
Cheulmen  Offline
Newbie
C

Joined: Nov 2017
Posts: 34
@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

Re: BitTrex Plugin (Crypto Trading) [Re: vinsom] #469306
11/10/17 17:05
11/10/17 17:05
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline
Senior Member
nanotir  Offline
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
Originally Posted By: vinsom

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


Where can I get that?

Re: BitTrex Plugin (Crypto Trading) [Re: nanotir] #469307
11/10/17 17:24
11/10/17 17:24
Joined: Nov 2017
Posts: 34
C
Cheulmen Offline
Newbie
Cheulmen  Offline
Newbie
C

Joined: Nov 2017
Posts: 34
@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

Re: BitTrex Plugin (Crypto Trading) [Re: Cheulmen] #469346
11/11/17 23:09
11/11/17 23:09
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline
Senior Member
nanotir  Offline
Senior Member
N

Joined: Mar 2015
Posts: 336
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?

Re: BitTrex Plugin (Crypto Trading) [Re: nanotir] #469349
11/11/17 23:59
11/11/17 23:59
Joined: Nov 2017
Posts: 34
C
Cheulmen Offline
Newbie
Cheulmen  Offline
Newbie
C

Joined: Nov 2017
Posts: 34
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

Re: BitTrex Plugin (Crypto Trading) [Re: Cheulmen] #469356
11/12/17 10:18
11/12/17 10:18
Joined: Nov 2016
Posts: 103
NSW
V
vinsom Offline OP
Member
vinsom  Offline OP
Member
V

Joined: Nov 2016
Posts: 103
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 = "??????????????????????"

Re: BitTrex Plugin (Crypto Trading) [Re: vinsom] #469363
11/12/17 17:42
11/12/17 17:42
Joined: Nov 2017
Posts: 34
C
Cheulmen Offline
Newbie
Cheulmen  Offline
Newbie
C

Joined: Nov 2017
Posts: 34
Ok, I had the keys exchanged. Now it connects laugh

Re: BitTrex Plugin (Crypto Trading) [Re: Cheulmen] #469374
11/13/17 14:26
11/13/17 14:26
Joined: Sep 2016
Posts: 20
France
J
JohanAu Offline
Newbie
JohanAu  Offline
Newbie
J

Joined: Sep 2016
Posts: 20
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

Re: BitTrex Plugin (Crypto Trading) [Re: JohanAu] #469380
11/13/17 19:07
11/13/17 19:07
Joined: Nov 2016
Posts: 103
NSW
V
vinsom Offline OP
Member
vinsom  Offline OP
Member
V

Joined: Nov 2016
Posts: 103
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

Page 3 of 7 1 2 3 4 5 6 7

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1