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
#475857 - 01/10/19 16:28 There is something wrong in live trading !!!
Chuate Offline
Newbie

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

This test doesn't work correctly in live trading.

For example: This is BTC chart in trading view and Zorro chart same time.



In tradingview, price is above ema50 but in Zorro chart, it below ema50. Also, There is some losing period


Can you tell me how to fix it ? Thank you !
Below is test code I use
Code:
function run()
{
	
	set(PLOTNOW|PARAMETERS);
   asset("BTCUSDT");
	BarPeriod = 1;
	LookBack = 100;
	Weekend = 0;
	
	vars Price = series(priceClose());
	vars ema5 = series(EMA(Price, 50));

	if (Price[0] < ema5[0])

	{
		char message[300];
		sprintf(message,"n price: %.10f, EMA5: %.10f", (var)Price[0], (var)ema5[0]);
		printf(message);
		enterLong();

	}

	plot("ema", ema5, MAIN, BLUE);

}


Top
#475863 - 01/10/19 20:16 Re: There is something wrong in live trading !!! [Re: Chuate]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26694
Loc: Frankfurt
Your script plots no live chart. The image that you posted is only updated once per day. If you want to check the EMA any minute, print it to the window. And better don't trade that script live. It will open thousands of trades after a while.

If an EMA50 is above or below the price curve depends not only on the price source, but also on the UnstablePeriod variable. Details in the manual.

Top
#475867 - 01/11/19 04:18 Re: There is something wrong in live trading !!! [Re: jcl]
Chuate Offline
Newbie

Registered: 12/25/18
Posts: 22
Loc: VN
Thank you for answering !
So, if I use 220 EMA, I should add below code ?
Code:
UnstablePeriod = 250; // > 220 EMA
LookBack = 100+UnstablePeriod;


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