Ho seguito il corso Multicharts based “Supremacy” (quasi al 100%) di Ungher. Molto interessante. Nel corso Andrea ha seguito questa organizzazione del codice: inserire i vari patterns di prezzo in una libreria e poi richiamarla dai differenti trading systems. Mi sembra che proRealTime non possa creare librerie di codice e funzioni definite dall’utente. Mi confermate? In caso negativo la soluzione potrebbe essere quella di testare i patterns su Multicharts e poi tradurre il trading system su ProRealTime. Mi date per cortesia feedback? Devo capire come organizzarmi e se usare ProRealTime. Grazie
https://www.prorealcode.com/blog/video-tutorials/creating-custom-indicators-prorealtime-2/
questo è un tutorial per creare indicatori.
Puoi crearne uno che restituisca valori diversi secondo i pattern rilevati e poi richiamarlo con CALL da una strategia.
Roberto
ALEModerator
Master
Ciao
ti crei tutti i pattern , poi li puoi o richiamare nel codice come quando richiami gli indicatori, oppure li inserisci nel codice della strategia componendoli i tuoi bias
Il video non esiste ma sicuramente c’è ne saranno altri.
AVTParticipant
Senior
Ecco l’elenco: https://www.youtube.com/channel/UC8bNosI3wuid_3Ze7CzorvA/videos
Anche se Nicolas parla francese, le immagini mostrano come lo fa.
Ho usato per lavorare con Andrea Unger e ho fatto i modelli come una biblioteca. Purtroppo, non ho abbastanza tempo per aiutarlo molto per avere le sue strategie in fase di sviluppo. Tuttavia, la libreria dei modelli è stata l’ultima cosa che ho fatto e sta funzionando correttamente, finché capisco la sua funzionalità nella propria strategia.
ciao Andrea, non è eccessivamente complicato. Prima devi creare indicatori, uno per ogni pattern, ad esempio:
Indicatore che chiamerai “Pattern01”
// Body del giorno precedente < 50% del range del giorno precedente
myRange = Dhigh(0) - Dlow(0)
myBody = abs(Dclose(0) - Dopen(0))
ratio = 0.5
if ((myBody/myRange) < ratio) then
PTRN001 = 1
else
PTRN001 = 0
endif
return PTRN001 as "Pattern001"
poi imposti le condizioni di acquisto in proOrder generando questo codice:
// Definizione dei parametri del codice
DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
// Condizioni per entrare su posizioni long
indicator1 = CALL "Pattern01"
c1 = (indicator1[0] = 1)
IF ( c1 ) THEN
BUY 100 SHARES AT MARKET
ENDIF
se oggi si verifica il pattern1 la piattaforma entrerà in acquisto.
Ho fatto una libreria di 42 modelli da includere in un unico programma per l’ottimizzazione. Poiché questi schemi sono stati utilizzati 4 volte nella stessa strategia, l’ottimizzatore non è sufficiente per verificare in una sola volta ogni singola combinazione (supera la limitazione delle variabili ottimizzatore> 100.000 combinazioni).
ciao Nicholas, includerli tutti in un unico codice penso sia pesantissimo per il sistema. Come hai fatto a formattare il mio post in quel modo? Grazie
Per quanto riguarda il lavoro di Andrea Unger, non pubblicherò la libreria dei modelli. Ma in un programma ProOrder è possibile utilizzarlo come segue:
// --- indis
// LY,SY,LN,SN are the different "numeropattern" optimized differently for your 40 different variables MyPtnLY, MyPTnLN, MyPtnSY and MyPtnSN
// You can modify your desired patterns for each of these variables in the variable optimisation window above (choose there if these variables are fixed or optimised from 1 to 40).
MyPtnLY = CALL "PRC_AndreaUngerPatterns"[LY]
MyPTnLN = CALL "PRC_AndreaUngerPatterns"[LN]
MyPtnSY = CALL "PRC_AndreaUngerPatterns"[SY]
MyPtnSN = CALL "PRC_AndreaUngerPatterns"[SN]
// ---
Questo non è tanto che il modo in cui lo hai già fatto!
Grazie per l’auto vedo di sistemare il codice che avete suggerito.
Hai già fatto sistemi con i pattern? Senza dire i pattern puoi allegare un template di schema di trading system? Grazie
Questa è la strategia ma senza i modelli che vengono chiamati come funzioni.
//DevelopBias
//60 minutes
defparam cumulateorders=false
// --- input parameters
MyLEbar = 1
MyLXbar = 2
MySEbar = 1
MySXbar = 2
MyNotLEDay = 0
MyNotSEDay = 0
MyStop = 0
MyProfit = 0
mycounter = 0
testphase = 1
// ---
// --- indis
// LY,SY,LN,SN are the different "numeropattern" optimized differently for your 40 different variables MyPtnLY, MyPTnLN, MyPtnSY and MyPtnSN
// You can modify your desired patterns for each of these variables in the variable optimisation window above (choose there if these variables are fixed or optimised from 1 to 40).
MyPtnLY = CALL "PRC_AndreaUngerPatterns"[LY]
MyPTnLN = CALL "PRC_AndreaUngerPatterns"[LN]
MyPtnSY = CALL "PRC_AndreaUngerPatterns"[SY]
MyPtnSN = CALL "PRC_AndreaUngerPatterns"[SN]
// ---
if intradaybarindex=0 then
mycount=0
endif
mycount=mycount+1
if testphase = 0 then
if mycounter = mycount then
buy 1 share at market
endif
if longonmarket then
sell at market
endif
endif
if testphase = 1 then
if mycount = MyLEbar and MyptnLY and not MyptnLN and opendayofweek <> MyNotLEDay then
buy 1 share at market
endif
if mycount = MyLXbar then
sell at market
endif
IF mycount = MySEbar and MyPtnSY and not MyPtnSN and opendayofweek <> MyNotSEDay then
sellshort 1 share at market
endif
if mycount = MySXbar then
exitshort at market
endif
endif
If MyStop > 0 then
set stop ploss MyStop
endif
if MyProfit> 0 then
set target pprofit MyProfit
endif