Live trading doesn't work correctly

Posted By: Chuate

Live trading doesn't work correctly - 01/11/19 12:29

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);
}

Posted By: Chuate

Re: Live trading doesn't work correctly - 01/13/19 00:33

No one haven't faced this problem ?
Posted By: AndrewAMD

Re: Live trading doesn't work correctly - 01/13/19 00:53

Try plotting your data so you can see what your indicators are doing.
Posted By: Chuate

Re: Live trading doesn't work correctly - 01/13/19 01:30

yes, it worked incorrectly but don't know how to fix it
Posted By: AndrewAMD

Re: Live trading doesn't work correctly - 01/13/19 01:36

Plot with Zorro.
Posted By: Chuate

Re: Live trading doesn't work correctly - 01/13/19 01:59

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:
Posted By: Petra

Re: Live trading doesn't work correctly - 01/13/19 02:10

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?
Posted By: Chuate

Re: Live trading doesn't work correctly - 01/13/19 02:22

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:
Posted By: Petra

Re: Live trading doesn't work correctly - 01/13/19 21:19

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.
Posted By: Chuate

Re: Live trading doesn't work correctly - 01/14/19 13:49

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"
© 2024 lite-C Forums