[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TS calculation problem



PureBytes Links

Trading Reference Links

Coding some indicators based on array correlations, I suddenly faced this
problem that I would like to submit to the list.

 

I code a simple indicator showing nothing more than a multiplication between
two numbers (the purpose is just to show the trouble)

 

value1=118.27*118.23;

Plot1(value1,"prova");

Print(date," ",time," ",value1:0:5);

 

In excel the result is 13983,0621

 

The indicator Plot shows 13986.06 and the Print shows 13983.10 (the number
has been rounded in excess)

 

I made some tests with various combinations and my conclusion is that if
there is a decimal number with intportion max of 3 (eg 999.xxxxx) there is
no rounding, but if the intportion result is more than 3, the decimal part
(and so the whole number) is not correct.

 

I made also various changes in TS Indicator configuration (decimal,
fractions.....) but did'nt solve.

 

The problem came out testing a simple array correlation. If one uses the
built in "Correlation_a" and put at least 8 elements for each array. The
result is not the same as the same correlation result in excel and I think
the trouble is in this "rounding decimal".

 

I wonder if someone else faced this problem or have a solution.

 

Thanks

 

Max 



Nota di riservatezza: il presente messaggio, corredato dei relativi
allegati, contiene informazioni da considerarsi strettamente riservate ed e
destinato esclusivamente al destinatario sopra indicato, il quale e l'unico
autorizzato ad usarlo, copiarlo e, sotto la propria responsabilita,
diffonderlo. Chiunque ricevesse questo messaggio per errore o comunque lo
leggesse senza esserne legittimato e avvertito che trattenerlo, copiarlo,
divulgarlo, distribuirlo a persone diverse dal destinatario e severamente
proibito ed e pregato di rinviarlo immediatamente al mittente distruggendo
l'originale. Grazie.

Confidentiality notice: this message, together with its annexes, contains
information to be deemed strictly confidential and is destined only to the
addressee(s) identified above who only may use, copy and, under his/their
responsibility, further disseminate it. If anyone received this message by
mistake or reads it without entitlement is forewarned that keeping, copying,
disseminating or distributing this message to persons other than the
addressee(s) is strictly forbidden and is asked to transmit it immediately
to the sender and to erase the original message received. Thank you.