Bollinger Breakout Dax
Forums › ProRealTime English forum › ProOrder support › Bollinger Breakout Dax
- This topic has 4 replies, 4 voices, and was last updated 3 years ago by Vonasi.
-
-
12/18/2020 at 9:54 PM #154360
Hi all,
I’ve tried out a little through ProOrder and wrote this code.
But it doesn’t generate any trades.
Timeframe M5.
Can anybody tell me, where the mistake is?
Thanks
//BB_Breakout_v0.91234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162Defparam cumulateorders = FalseDefparam preloadbars = 150DEFPARAM FlatAfter = 215500 // Positionen werden um 21:55 Uhr glattgestellt// Variablen// BBFaktor = 2 //Faktor Standardabweichung BB// TB = 100 // neues BBwidth-Tief seit 100 Perioden// FB = 1.2 // Faktor Bandbreite für Stoploss-Bestimmung// CRV = 1.5 // gewünschtes CRV; TP = CRV*Stoploss// BBBT = 10 // minimale Bandbreite für Einstieg// BBBH = 40 // maximale Bandbreite für Einstieg//Times for the strategy to workIF (Month = 5 AND Day = 1) OR (Month = 12 AND (Day = 24 OR Day = 25 OR Day = 26 OR Day = 30 OR Day = 31)) OR (Month = 1 AND (Day = 1 OR Day = 6)) OR (Month = 10 AND Day = 3) OR Time < 090000 OR Time > 204500 THENt = 0ELSEt = 1ENDIF//indicatorsBBM = Average[20](close)BBUp = BBM + BBFaktor * STD[20](close)BBDown = BBM - BBFaktor * STD[20](close)BBwidth = BBUp - BBDowna1 = lowest[3](BBwidth) = lowest[100](BBwidth)a2 = BBwidth > BBBTa3 = BBwidth < BBBHo1 = close > BBUpo2 = close < BBDown//Wert StoplossIF a1 AND a2 AND a3 AND o1 OR o2 THENSL = BBwidth * FBENDIF//Wert TakeprofitTP = SL * CRV//Position size managementCapital = 5000Risk = 0.01Equity = Capital + StrategyProfitMaxRisk = Equity * RiskPositionSize = MaxRisk/SL//conditions for entry longIF not longonmarket AND t = 1 AND a1 AND a2 AND a3 AND o1 THENBUY Positionsize Contract AT MarketENDIF//conditions for entry shortIF not shortonmarket AND t = 1 AND a1 AND a2 AND a3 AND o2 THENSELLSHORT Positionsize Contract AT MarketENDIF//Stop and TargetSet Stop ploss SLSet Target pProfit TP12/18/2020 at 10:01 PM #154362You should uncomment lines 8-13.
12/21/2020 at 8:23 AM #154689Hello Roberto,
I’ve defined these variables in ProRealTime, as you can see in the attached itf-File.
The ambition is to optimize these variables, after a first strategy test.
But the strategy still doesnt’t bring any results. Is there maybe another fault in the syntax?
If there were variables used in a code, that are not defined, isn’t ProRealTime generating an error note then?
Thank you.
12/21/2020 at 10:04 AM #154698Not sure, but maybe the reason you don´t get any operation could be because of the minimun size of the instrument you are operating.
For instance the DAX have a minimun position size of 0,5 so as your “Position Size Management” calculates a lower position size the operation doesn´t execute
To avoid that you should code a minimun position size
12/21/2020 at 11:45 AM #154711Have you checked that all your conditions are actually ever true at the same time?
It might be worth creating an indicator just to test this. Something like this (not tested):
12345678910111213141516171819202122232425262728293031323334353637BBFaktor = 2 //Faktor Standardabweichung BBTB = 100 // neues BBwidth-Tief seit 100 PeriodenFB = 1.2 // Faktor Bandbreite für Stoploss-BestimmungCRV = 1.5 // gewünschtes CRV; TP = CRV*StoplossBBBT = 10 // minimale Bandbreite für EinstiegBBBH = 40 // maximale Bandbreite für Einstieg//Times for the strategy to workIF (Month = 5 AND Day = 1) OR (Month = 12 AND (Day = 24 OR Day = 25 OR Day = 26 OR Day = 30 OR Day = 31)) OR (Month = 1 AND (Day = 1 OR Day = 6)) OR (Month = 10 AND Day = 3) OR Time < 090000 OR Time > 204500 THENt = 0ELSEt = 1ENDIF//indicatorsBBM = Average[20](close)BBUp = BBM + BBFaktor * STD[20](close)BBDown = BBM - BBFaktor * STD[20](close)BBwidth = BBUp - BBDowna1 = lowest[3](BBwidth) = lowest[100](BBwidth)a2 = BBwidth > BBBTa3 = BBwidth < BBBHo1 = close > BBUpo2 = close < BBDown//conditions for entry longIF t = 1 AND a1 AND a2 AND a3 AND o1 THENflag1 = flag1 + 1ENDIF//conditions for entry shortIF t = 1 AND a1 AND a2 AND a3 AND o2 THENflag2 = flag2 + 1ENDIFreturn flag1 as "Long Conditions Hit", flag2 as "Short Conditions Hit" -
AuthorPosts
Find exclusive trading pro-tools on