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

 All Forums
 Help
 Aiuti, consigli, dubbi ...
 Moduli
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

VpV
Utente Medio

155 Posts

Posted - 24 May 2012 :  16:04:03  Show Profile  Reply with Quote
Buon pomeriggio,

ho fatto un piccolo madulo che genera il prezzo tipico. Tutto funziona ovviamente, nessun problema nel richiamare il modulo nelle funzioni Main.

Però ho un problema a quale dato voglio importare.

Se volessi importare il prezzo tipico, TP, del giorno precedente allora non ci riesco.

TP - TP(-1)...non riesco a farlo. Sbaglio oppure per i moduli non è possibile fare questo ?

Grazie.

SupportoTecnico
Forum Admin

1261 Posts

Posted - 25 May 2012 :  10:36:37  Show Profile  Reply with Quote
Se ho capito bene, hai creato una (o più) funzioni in un modulo di servizio, in modo da poter poi richiamare tale funzione all'interno di diversi indicatori o trading system.

Quindi avrai scritto una cosa del tipo:


Function TP() as Numeric
   .......
   ......
   Return ....
EndFunction


La sintassi: Close(-1) può essere utilizzata solo per alcune funzioni come per esempio le funzioni dati: open, high, low close ecc...

Questa sintassi non la puoi utilizzare con le funzioni da te costruite. O meglio, non è automatica.

Se vuoi utilizzare una sintassi di quel tipo dovrai prevedere un parametro nella funzione, e poi utilizzare questo parametro all'interno della funzione stessa per restituire il guisto valore. Per esempio:


Function TP(offset as Numeric) as Numeric
    Return Close - Close(-offset)
EndFunction


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