Insider 3000 - Forums
Insider 3000 - Forums
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Problemi con "Insider 3000 versione 3"
 Problemi col linguaggio di programmazione
 Costruire un indicatore tipo RSI
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jsamu
Nuovo Utente

28 Posts

Posted - 26 October 2003 :  18:28:56  Show Profile  Reply with Quote
Vorrei costruire un indicatore simile al RSI ma che invece di utilizzare la media chiusure positive o negative consideri la somma in un determinato periodo di tempo. Ma non vedo proprio nulla…
Dove sbaglio questa volta?

Function Main()

dim i as Numeric
dim ChiusuraSu as Numeric
dim ChiusuraGiu as Numeric

i = 0
ChiusuraSu = 0
ChiusuraGiu = 0

Do until (i <= periodo)
If close > open Then
ChiusuraSu = ChiusuraSu + 1
Endif

If close < open Then
ChiusuraGiu = ChiusuraGiu + 1
Endif

i = i + 1

Loop

'Return ChiusuraSu
Return 100 - (100 / (1 + (ChiusuraSu / ChiusuraGiu)))

Endfunction

Property periodo as Numeric
Default (14)
EndProperty


SupportoTecnico
Forum Admin

1261 Posts

Posted - 27 October 2003 :  11:18:04  Show Profile  Reply with Quote
C'erano diverse imprecisioni. Prova questo:

Function Main()

dim i as Numeric
dim ChiusuraSu as Numeric
dim ChiusuraGiu as Numeric

i = 0
ChiusuraSu = 0
ChiusuraGiu = 0

for i = 0 to periodo - 1
If close( - i) > open( - i) Then
ChiusuraSu = ChiusuraSu + 1
Endif

If close( - i) < open( - i) Then
ChiusuraGiu = ChiusuraGiu + 1
Endif
next i

if (ChiusuraGiu <> 0) then
Return 100 - (100 / (1 + (ChiusuraSu / ChiusuraGiu)))
else
Return 0
endif

Endfunction

Property periodo as Numeric
Default (14)
EndProperty

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Insider 3000 - Forums © Copyright 2003-2016 Tradersoft s.r.l. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07