non operare per le prossime 5 barre
Forums › ProRealTime forum Italiano › Supporto ProOrder › non operare per le prossime 5 barre
- This topic has 6 replies, 4 voices, and was last updated 7 years ago by Mauro T. “Algorithm System”.
-
-
12/03/2016 at 9:43 AM #1774712/05/2016 at 4:24 PM #17825
Credo che qualcosa di simile dovrebbe essere ok:
12345if onmarket[1]=1 and onmarket=0 thenstart = barindexendifcondition = barindex-start>=5
(Non testato, quindi per favore dirci se si sta lavorando bene per voi, grazie).1 user thanked author for this post.
01/12/2017 at 12:41 PM #20836123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172Buongiorno,Vorrei inserire ma non riesco in questo sistema trovato nel sito Prorealcode il codice da lei scritto qui sopra per non operare per le prosime 5 Barre.La ringrazio anticipatamente per la sua cortesiaMauro<span class="token keyword">DEFPARAM</span> <span class="token keyword">CumulateOrders</span> <span class="token operator">=</span> FALSE<span class="token keyword">DEFPARAM</span> <span class="token keyword">FlatBefore</span> <span class="token operator">=</span> <span class="token number">080000</span><span class="token keyword">DEFPARAM</span> <span class="token keyword">FlatAfter</span> <span class="token operator">=</span> <span class="token number">212900</span><span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token keyword">time</span> <span class="token operator">>=</span><span class="token number">080000</span> <span class="token keyword">and</span> <span class="token keyword">time</span> <span class="token operator"><</span> <span class="token number">110000</span><span class="token punctuation">)</span> <span class="token keyword">or</span> <span class="token punctuation">(</span><span class="token keyword">time</span> <span class="token operator">>=</span> <span class="token number">134500</span> <span class="token keyword">and</span> <span class="token keyword">time</span> <span class="token operator"><</span><span class="token number">181400</span><span class="token punctuation">)</span> <span class="token keyword">then</span>indicator1<span class="token punctuation">,</span> ignored <span class="token operator">=</span> <span class="token keyword">CALL</span> <span class="token string">"BLUSTER DAX"</span>c1 <span class="token operator">=</span> <span class="token punctuation">(</span>indicator1 <span class="token operator">>=</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token keyword">IF</span> c1 <span class="token keyword">AND</span> <span class="token keyword">CurrentDayOfWeek</span> <span class="token operator"><</span><span class="token operator">></span> <span class="token number">1</span> <span class="token keyword">THEN</span><span class="token keyword">BUY</span> <span class="token number">1</span> <span class="token keyword">CONTRACT</span> <span class="token keyword">AT</span> <span class="token keyword">MARKET</span><span class="token keyword">ENDIF</span>indicator2<span class="token punctuation">,</span> ignored <span class="token operator">=</span> <span class="token keyword">CALL</span> <span class="token string">"BLUSTER DAX"</span>c2 <span class="token operator">=</span> <span class="token punctuation">(</span>indicator2 <span class="token operator"><=</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token keyword">IF</span> c2 <span class="token keyword">THEN</span><span class="token keyword">SELL</span> <span class="token keyword">AT</span> <span class="token keyword">MARKET</span><span class="token keyword">ENDIF</span>indicator3<span class="token punctuation">,</span> ignored <span class="token operator">=</span> <span class="token keyword">CALL</span> <span class="token string">"BLUSTER DAX"</span>c3 <span class="token operator">=</span> <span class="token punctuation">(</span>indicator3 <span class="token operator"><=</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token keyword">IF</span> c3 <span class="token keyword">AND</span> <span class="token keyword">CurrentDayOfWeek</span> <span class="token operator"><</span><span class="token operator">></span> <span class="token number">1</span> <span class="token keyword">THEN</span><span class="token keyword">SELLSHORT</span> <span class="token number">1</span> <span class="token keyword">CONTRACT</span> <span class="token keyword">AT</span> <span class="token keyword">MARKET</span><span class="token keyword">ENDIF</span>indicator4<span class="token punctuation">,</span> ignored <span class="token operator">=</span> <span class="token keyword">CALL</span> <span class="token string">"BLUSTER DAX"</span>c4 <span class="token operator">=</span> <span class="token punctuation">(</span>indicator4 <span class="token operator">>=</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token keyword">IF</span> c4 <span class="token keyword">THEN</span><span class="token keyword">EXITSHORT</span> <span class="token keyword">AT</span> <span class="token keyword">MARKET</span><span class="token keyword">ENDIF</span><span class="token comment" spellcheck="true">// TRAILING STOP LOGIK BY KENNETH KVISTAD MODIFIED FOR LONG AND SHORT POSITION</span>TGL <span class="token operator">=</span><span class="token number">47</span>TGS<span class="token operator">=</span> <span class="token number">41</span><span class="token keyword">if</span> <span class="token keyword">not</span> <span class="token keyword">onmarket</span> <span class="token keyword">then</span>MAXPRICE <span class="token operator">=</span> <span class="token number">0</span>MINPRICE <span class="token operator">=</span> <span class="token keyword">close</span>PREZZOUSCITA <span class="token operator">=</span> <span class="token number">0</span><span class="token keyword">ENDIF</span><span class="token keyword">if</span> <span class="token keyword">longonmarket</span> <span class="token keyword">then</span>MAXPRICE <span class="token operator">=</span> <span class="token keyword">MAX</span><span class="token punctuation">(</span>MAXPRICE<span class="token punctuation">,</span><span class="token keyword">close</span><span class="token punctuation">)</span><span class="token keyword">if</span> MAXPRICE<span class="token operator">-</span><span class="token keyword">tradeprice</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">>=</span>TGL<span class="token operator">*</span><span class="token keyword">pointsize</span> <span class="token keyword">then</span>PREZZOUSCITA <span class="token operator">=</span> MAXPRICE<span class="token operator">-</span>TGL<span class="token operator">*</span><span class="token keyword">pointsize</span><span class="token keyword">ENDIF</span><span class="token keyword">ENDIF</span><span class="token keyword">if</span> <span class="token keyword">shortonmarket</span> <span class="token keyword">then</span>MINPRICE <span class="token operator">=</span> <span class="token keyword">MIN</span><span class="token punctuation">(</span>MINPRICE<span class="token punctuation">,</span><span class="token keyword">close</span><span class="token punctuation">)</span><span class="token keyword">if</span> <span class="token keyword">tradeprice</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">-</span>MINPRICE<span class="token operator">>=</span>TGS<span class="token operator">*</span><span class="token keyword">pointsize</span> <span class="token keyword">then</span>PREZZOUSCITA <span class="token operator">=</span> MINPRICE<span class="token operator">+</span>TGS<span class="token operator">*</span><span class="token keyword">pointsize</span><span class="token keyword">ENDIF</span><span class="token keyword">ENDIF</span><span class="token keyword">if</span> <span class="token keyword">onmarket</span> <span class="token keyword">and</span> PREZZOUSCITA<span class="token operator">></span><span class="token number">0</span> <span class="token keyword">then</span><span class="token keyword">EXITSHORT</span> <span class="token keyword">AT</span> PREZZOUSCITA <span class="token keyword">STOP</span><span class="token keyword">SELL</span> <span class="token keyword">AT</span> PREZZOUSCITA <span class="token keyword">STOP</span><span class="token keyword">ENDIF</span><span class="token keyword">SET STOP</span> <span class="token keyword">PLOSS</span> <span class="token number">70</span><span class="token keyword">SET TARGET</span> <span class="token keyword">PPROFIT</span> <span class="token number">87</span><span class="token keyword">ENDIF</span>01/12/2017 at 1:23 PM #2085001/12/2017 at 2:39 PM #20863Ciao Ale,
sto verificando il sistema da inserito circa 3 mesi fà ( BLUSTER DAX intraday trading strategy ),
Ma vorrei evitare una volta arrivato a target di rientrare subito nelle barre successive ( poi da verificare il numero di barre successive conle variabili ) semore nella stessa direzione.
Ciao Mauro
P.S. purtroppo non sono riuscito aprire il file .itf
01/12/2017 at 3:01 PM #20866CIAO
IL FILE ITF :
FAI IL DOWLOAD E POI SEGUI LE ISTRUZIONI DEL LINK SOTTOSTANTE:
https://www.prorealcode.com/import-export-prorealtime-code-platform/01/12/2017 at 3:37 PM #20874Ciao,
Ecco il sistema da qui come ti dicevo prima vorrei evitare una volta arrivato a target di rientrare subito nelle barre successive.
Grazie
Mauro
// THIS SIMPLE STRATEGY CATCH PROFIT BY UNIVERSAL INDICATOR
// IG MARKET GERMANY CASH 1 EUR MINI – SPREAD 1 – 15 M
DEFPARAM CumulateOrders = FALSE
DEFPARAM FlatBefore = 080000
DEFPARAM FlatAfter = 212900
if (time >=080000 and time < 110000) or (time >= 134500 and time <181400) then
if onmarket[1]=1 and onmarket=0 then
start = barindex
endifcondition = barindex-start>=5
indicator1, ignored = CALL “BLUSTER DAX”
c1 = (indicator1 >= 1)IF c1 AND CurrentDayOfWeek <> 1 AND CONDITION THEN
BUY 1 CONTRACT AT MARKET
ENDIFindicator2, ignored = CALL “BLUSTER DAX”
c2 = (indicator2 <= -1)IF c2 THEN
SELL AT MARKET
ENDIFindicator3, ignored = CALL “BLUSTER DAX”
c3 = (indicator3 <= -1)IF c3 AND CurrentDayOfWeek <> 1 AND CONDITION THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIFindicator4, ignored = CALL “BLUSTER DAX”
c4 = (indicator4 >= 1)IF c4 THEN
EXITSHORT AT MARKET
ENDIF// TRAILING STOP LOGIK BY KENNETH KVISTAD MODIFIED FOR LONG AND SHORT POSITION
TGL =47
TGS= 41if not onmarket then
MAXPRICE = 0
MINPRICE = close
PREZZOUSCITA = 0
ENDIFif longonmarket then
MAXPRICE = MAX(MAXPRICE,close)
if MAXPRICE-tradeprice(1)>=TGL*pointsize then
PREZZOUSCITA = MAXPRICE-TGL*pointsize
ENDIF
ENDIFif shortonmarket then
MINPRICE = MIN(MINPRICE,close)
if tradeprice(1)-MINPRICE>=TGS*pointsize then
PREZZOUSCITA = MINPRICE+TGS*pointsize
ENDIF
ENDIFif onmarket and PREZZOUSCITA>0 then
EXITSHORT AT PREZZOUSCITA STOP
SELL AT PREZZOUSCITA STOP
ENDIFSET STOP PLOSS 70
SET TARGET PPROFIT 87
ENDIF
// REGARDS ALE -
AuthorPosts
Find exclusive trading pro-tools on