Gamestudio Links
Zorro Links
Newest Posts
Blog Post: Get Historical Data from Darwinex REST API w/ Zorro
by AndrewAMD
Yesterday at 22:19
Reseting a static variable - the next day
by OptimusPrime
Yesterday at 19:48
Correlation -1.#IND00
by AndrewAMD
Yesterday at 17:44
Basic thread safety question
by Superku
Yesterday at 17:43
Train algorithms separatery
by 3dgamelight
01/18/19 10:37
+BALANCED machine learning option
by jcl
01/18/19 08:37
IntraBar fluctuation
by jcl
01/18/19 08:31
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
4 registered (AndrewAMD, Superku, 2 invisible), 499 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
laz, ramonne, SibJac, Evael, NRW
18156 Registered Users
Topic Options
Rate This Topic
#475876 - 01/11/19 13:29 Live trading doesn't work correctly
Chuate Offline
Newbie

Registered: 12/25/18
Posts: 22
Loc: VN
Hello,
The image tell everything.

Zorro say price > ema50,80, 220 while price in Binance < ema50, 80 and 220. All ema value is different. So, can you show me what is problem ?


In the log file, I see most recent 200 price is same
Quote:
0.000006850. Price[0], Price[1], Price[2],... Price[n] is same. So I think that is reason why the ema50 and 80 is 00000685.

[495: Fri 19-01-11 12:15] (0.000006850)
price: 0.00000685, EMA5: 0.00000685, ema80 : 0.00000685, ema220: 0.00000670
price > ema 50
price > ema 80
price > ema 220
[496: Fri 19-01-11 12:15] (0.000006850)
price: 0.00000685, EMA5: 0.00000685, ema80 : 0.00000685, ema220: 0.00000670
price > ema 50
price > ema 80
price > ema 220
[497: Fri 19-01-11 12:15] (0.000006850)
price: 0.00000685, EMA5: 0.00000685, ema80 : 0.00000685, ema220: 0.00000670
price > ema 50
price > ema 80
price > ema 220
[498: Fri 19-01-11 12:15] (0.000006850)
price: 0.00000685, EMA5: 0.00000685, ema80 : 0.00000685, ema220: 0.00000670
price > ema 50
price > ema 80
price > ema 220
[499: Fri 19-01-11 12:15] (0.000006850)
price: 0.00000685, EMA5: 0.00000685, ema80 : 0.00000685, ema220: 0.00000670
price > ema 50
price > ema 80
price > ema 220

End of lookback period

[500: Fri 19-01-11 12:20] (0.000006870)
price: 0.00000687, EMA5: 0.00000685, ema80 : 0.00000685, ema220: 0.00000670
price > ema 50
price > ema 80
price > ema 220
[501: Fri 19-01-11 12:25] (0.000006850)
price: 0.00000685, EMA5: 0.00000685, ema80 : 0.00000685, ema220: 0.00000671
price > ema 220


This is code I use:

Code:
function run()
{
	
	set(PLOTNOW|PARAMETERS);
   asset("TRXBTC");
	BarPeriod = 5;
	UnstablePeriod = 250;
	LookBack = 250+UnstablePeriod;
	Weekend = 0;
	
	vars Price = series(priceClose());
	vars ema50 = series(EMA(Price, 50));
	vars ema80 = series(EMA(Price, 80));
	vars ema220 = series(EMA(Price, 220));

		char message[300];
		sprintf(message,"n price: %.8f, EMA5: %.8f, ema80 : %.8f, ema220: %.8f", (var)Price[0], (var)ema50[0], (var)ema80[0], (var)ema220[0]);
		printf(message);
		if (Price[0] > ema50[0]) printf(" n price > ema 50");
		if (Price[0] > ema80[0]) printf("n price > ema 80");
		if (Price[0] > ema220[0]) printf("n price > ema 220");
		//enterLong();



	plot("ema50", ema50, MAIN, BLUE);
	plot("ema80", ema80, MAIN, RED);
	plot("ema220", ema220, MAIN, BLACK);
}



Edited by Chuate (01/12/19 03:28)

Top
#475903 - 01/13/19 01:33 Re: Live trading doesn't work correctly [Re: Chuate]
Chuate Offline
Newbie

Registered: 12/25/18
Posts: 22
Loc: VN
No one haven't faced this problem ?

Top
#475904 - 01/13/19 01:53 Re: Live trading doesn't work correctly [Re: Chuate]
AndrewAMD Online
User

Registered: 02/21/17
Posts: 536
Loc: Chicago
Try plotting your data so you can see what your indicators are doing.

Top
#475905 - 01/13/19 02:30 Re: Live trading doesn't work correctly [Re: AndrewAMD]
Chuate Offline
Newbie

Registered: 12/25/18
Posts: 22
Loc: VN
yes, it worked incorrectly but don't know how to fix it


Edited by Chuate (01/13/19 02:30)

Top
#475906 - 01/13/19 02:36 Re: Live trading doesn't work correctly [Re: Chuate]
AndrewAMD Online
User

Registered: 02/21/17
Posts: 536
Loc: Chicago
Plot with Zorro.

Top
#475907 - 01/13/19 02:59 Re: Live trading doesn't work correctly [Re: AndrewAMD]
Chuate Offline
Newbie

Registered: 12/25/18
Posts: 22
Loc: VN
Hi, this is live chart after I run 2 minutes. Also, in the beginning, Zorro show:
Quote:
V 2.014 on Sun 19-01-13 08:54:02 (Zorro S Subscription)
Load TRXBTC prices.. 501 min, gap 122 h, 227 bars added


Why 122h gap ?



and this Binance chart:


Edited by Chuate (01/13/19 03:01)

Top
#475908 - 01/13/19 03:10 Re: Live trading doesn't work correctly [Re: Chuate]
Petra Offline
Member

Registered: 04/04/08
Posts: 213
It looks like missing price history. You can see this from "gap" warning and the jump between the last history price and the first live price. Probably your history is very old. EMA does not work with no history.

What history do you use?

Top
#475910 - 01/13/19 03:22 Re: Live trading doesn't work correctly [Re: Petra]
Chuate Offline
Newbie

Registered: 12/25/18
Posts: 22
Loc: VN
Hello Petra,

I don't understand why it need history price from my side. When I trade live, it will get history price from Binance ?

Anyway, this is my Asset list:

Top
#475915 - 01/13/19 22:19 Re: Live trading doesn't work correctly [Re: Chuate]
Petra Offline
Member

Registered: 04/04/08
Posts: 213
I dont know if binance has history, but many exchanges have not, better use the history from bittrex or cryptocompare. You have also no TRX in your assetlist.

Top
#475932 - 01/14/19 14:49 Re: Live trading doesn't work correctly [Re: Petra]
Chuate Offline
Newbie

Registered: 12/25/18
Posts: 22
Loc: VN
Thank you Petra laugh
I downloaded historical data from CryptoCompare then use PRELOAD flag then it worked. Also change "xxxxxx.t6" to "xxxxxx_2019.t6"

Top



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

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