Strategia trovata in PRT
Forums › ProRealTime forum Italiano › Supporto ProOrder › Strategia trovata in PRT
- This topic has 9 replies, 2 voices, and was last updated 2 years ago by robertogozzi.
-
-
04/26/2022 at 2:30 PM #192234
Ho trovato una strategia in libreria (di seguito riportato) che sembra funzionare, ma vorrei qualche commento. Inoltre esso prevede di decidere il numero max di ordini, ma qualsiasi numero metto il test da sempre da 1 a 5.
Grazie
/
Defparam CUMULATEORDERS = TRUE
//Defparam NOCASHUPDATE = TRUE
defparam flatbefore=151000
defparam flatafter=215000
//
//
//
Filtro =180
Sloss = sl // %
SProfit = tp // %
X = 0
Y = 1
Z = 2
//
//
//==== CONTRATOS A NEGOCIAR =========
//
Xhares = 1
//
// ====== Numero Maximo de contratos a negociar ============
//
Nshares = c
////
// ========== CODIGO ===================
//HULL = weightedaverage[filtro](close)
IF close[x] crosses over highest[h1](high[1]) and hull[y] > hull[z] and COUNTOFLONGSHARES < Nshares THEN
buy Xhares CONTRACTS AT MARKET
ENDIFIF close[x] crosses over highest[h2](high[1]) and hull[y] > hull[z] and COUNTOFLONGSHARES < Nshares THEN
buy Xhares CONTRACTS AT MARKET
ENDIFIF close[x] crosses over highest[h3](high[1]) and hull[y] > hull[z] and COUNTOFLONGSHARES < Nshares THEN
buy Xhares CONTRACTS AT MARKET
ENDIFIF close[x] crosses over highest[h4](high[1]) and hull[y] > hull[z] and COUNTOFLONGSHARES < Nshares THEN
buy Xhares CONTRACTS AT MARKET
ENDIFIF close[x] crosses over highest[h5](high[1]) and hull[y] > hull[z] and COUNTOFLONGSHARES < Nshares THEN
buy Xhares CONTRACTS AT MARKET
ENDIF
SET STOP %LOSS sloss
SET TARGET %PROFITsprofit04/26/2022 at 3:50 PM #192240Mancano delle variabili.
Allega il file ITF.
04/26/2022 at 4:01 PM #192241Nshares = 5
h1 h2 ecc. sono 5 , 20, 50, 100, 200
Grazie
04/26/2022 at 4:14 PM #192242Devi solo variare Nshares, così è 5, puoi aumentarlo o diminuirlo come preferisci.
04/26/2022 at 4:21 PM #192244In effetti entra spesso più volte all’interno della stessa candela, puoi provare questa versione modificata:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849Defparam CUMULATEORDERS = TRUE//Defparam NOCASHUPDATE = TRUEdefparam flatbefore=151000defparam flatafter=215000//////Filtro =180Sloss = 5SProfit = 5X = 0Y = 1Z = 2//////==== CONTRATOS A NEGOCIAR =========//Xhares = 1//// ====== Numero Maximo de contratos a negociar ============//h1 = 5h2 = 20h3 = 50h4 = 100h5 = 200Nshares = 5////// ========== CODIGO ===================//HULL = weightedaverage[filtro](close)IF close[x] crosses over highest[h1](high[1]) and hull[y] > hull[z] and abs(CountOfPosition) < Nshares THENbuy Xhares CONTRACTS AT MARKETELSIF close[x] crosses over highest[h2](high[1]) and hull[y] > hull[z] and abs(CountOfPosition) < Nshares THENbuy Xhares CONTRACTS AT MARKETELSIF close[x] crosses over highest[h3](high[1]) and hull[y] > hull[z] and abs(CountOfPosition) < Nshares THENbuy Xhares CONTRACTS AT MARKETELSIF close[x] crosses over highest[h4](high[1]) and hull[y] > hull[z] and abs(CountOfPosition) < Nshares THENbuy Xhares CONTRACTS AT MARKETELSIF close[x] crosses over highest[h5](high[1]) and hull[y] > hull[z] and abs(CountOfPosition) < Nshares THENbuy Xhares CONTRACTS AT MARKETENDIFSET STOP %LOSS slossSET TARGET %PROFITsprofit//graph abs(CountOfPosition)04/26/2022 at 5:55 PM #192248Grazie, comunque se modifico il 5 e per esempio ci metto 1, va comunque a mercato da 1 a 5.
04/26/2022 at 6:38 PM #192251Si, per questo ho fatto la modifica ai blocchi IF…ENDIF delle entrate.
05/17/2022 at 8:30 AM #193300Dal 26/4 uso questo codice , in demo, ma non è mai entrato a mercato. Coincidenza ?
Grazie
05/22/2022 at 10:57 AM #193645L’ho appena messo in demo anch’io. Vediamo nei prossimi giorni cosa fa.
05/26/2022 at 9:45 AM #193853Ad oggi state fatte due operazioni (sul DAX a 5 minuti), con varie entrate ciascuno.
La prima è stata perdente e la seconda vincente.
-
AuthorPosts
Find exclusive trading pro-tools on