ROBOT ADX
Forums › ProRealTime English forum › ProOrder support › ROBOT ADX
- This topic has 18 replies, 4 voices, and was last updated 6 years ago by Pablo Jimenez.
Tagged: Adx
-
-
09/26/2018 at 10:09 AM #81325
Hello everyone, I am interested in making a robot with only one condition, I need to open the operation at the close of the candle only if during the creation of the candle the ADX indicator has been in the range between 20 and 28. If it has been below or above I do not want to open the operation.
It’s possible?
Thank you09/26/2018 at 11:35 AM #81345Please update your country flag.
DO NOT post multiple times about the same topics!
DO NOT post using different languages from that of the forum!
Use the correct forum, this is strategy, not an indicator, so I will move it to the ProOrder support.
Thank you and welcome aboard!
09/26/2018 at 11:54 AM #81348You will have to use MTF (Multiple Time Frame) to achieve that, with your favourite TF set to DEFAULT behaviour (rather than UPDATEONCLOSE), then use a much lower TF to scan the forming higher candle as many times as possible:
12345678TIMEFRAME (4 hours,default)MyAdx = ADX[14]TIMEFRAME (default)ONCE ValidAdx = 1IF MyAdx < 20 OR MyAdx > 28 THENValidAdx = 0ENDIFlaunch it from a 1-minute chart, of course you will have to reset VALIDADX whenever you want, but that’s beyond your question.
1 user thanked author for this post.
09/27/2018 at 9:44 AM #81420Buenos dias, estoy intentando hacer un robot que estoy haciendo basándome en las siguientes condiciones:
Entradas para largos: Deben cumplirse todas y cada una de las condiciones, siempre operamos al cierre de vela.
1° El precio debe estar por encima de la EMA 8 (La vela debe haber cerrado por encima de ella).
2° El precio debe estar por encima de la Media Alisada de Wilder de 8 periodos.
3° El williams de 40 periodos debe estar por encima del valor -50.
4° Debe haber habido 2 cierres de vela anteriores por encima de la EMA 8.
5° La vela donde nos ha dado la entrada debe haber hecho un máximo mayor que el máximo de la vela justamente precedente.
6° Para que nos de entrada el adx durante dicha vela ha tenido que estar comprendido entre 17 y 28, (17 <=adx<= 28), es decir si durante el proceso de creación de la vela el valor de adx ha sido mayor o igual a 17 o menor o igual 28 y ademas se cumplen todas las anteriores condiciones, entonces abriríamos operación.Para las condiciones de entrada en corto serian las mismas condiciones para el adx simplemente k las demás condiciones serian al contrario ( willy<-50, precio por debajo de la ema8, de la media alisada, 2 mínimos… etc).
Para el cierre de la operación he propuesto 2 sistemas:
– Un stop de seguridad en x puntos.
– En el momento en el que el precio toque la media alisada de Wilder, es decir cuando el precio= media alisada de Wilder de 8 periodos, no tenemos porque esperar cierre de vela. En el momento que haga una mecha y toque la media la operación debe cerrarse.ADX+WILLY+EMA812345678910111213141516171819202122232425262728// Definición de los parámetros del códigoDEFPARAM CumulateOrders = False // Acumulación de posiciones desactivada// Condiciones para entrada de posiciones largasindicator1 = ExponentialAverage[8](close)c1 = (indicator1 < close)indicator2 = Williams[40](close)c2 = (indicator2 > -50)indicator3 = WilderAverage[8](close)c3 = (indicator3 < close)indicador4 = ADX[14]c4= (indicador4 >= 17 OR indicador4 <= 28)IF c1 AND c2 AND c3 and c4 THENBUY 5 CONTRACT AT MARKETENDIF// Condiciones de salida de posiciones largasindicator5 = WilderAverage[8](close)c5 = (indicator5 = close)IF c5 THENSELL AT MARKETENDIF// Stops y objetivosSET STOP pLOSS 100El codigo lo tengo comenzado pero no consigo implementar la condicion del ADX y estoy bloqueado, alguien podría ayudarme? Muchas gracias
09/27/2018 at 9:56 AM #8142209/27/2018 at 10:05 AM #81423Isn’t this the Issue (mutually exclusive?) …
12indicador4 = ADX[14]c4= (indicador4 >= 17 OR indicador4 <= 28)You need
12indicador4 = ADX[14]c4= (indicador4 >= 17 AND indicador4 <= 28)1 user thanked author for this post.
09/27/2018 at 10:41 AM #81426Good morning, I am trying to make a robot that I am doing based on the following conditions:
Long conditions: All the conditions must be fulfilled, we must open the position at the close of the candle.
1 ° The price must be above the EMA 8 (The candle must have closed above it).
2 ° The price must be above Wilder’s Smoothed Average of 8 periods.
3 ° The Williams of 40 periods must be above the value -50.
4 ° There must have been 2 previous candles closures above the EMA 8.
5 ° The candle where the entrance has given us must have made a maximum higher than the maximum of the just preceding candle.
6 ° To enter the adx during said candle has had to be between 17 and 28, (17 <= adx <= 28), that is if during the process of creating the candle the value of adx has been higher or equal to 17 or less or equal 28 and also all the above conditions are met, then we would open operation.For short entry conditions would be the same conditions for the adx but
12345678910111213141516171819202122232425262728// Definición de los parámetros del códigoDEFPARAM CumulateOrders = False // Acumulación de posiciones desactivada// Condiciones para entrada de posiciones largasindicator1 = ExponentialAverage[8](close)c1 = (indicator1 < close)indicator2 = Williams[40](close)c2 = (indicator2 > -50)indicator3 = WilderAverage[8](close)c3 = (indicator3 < close)indicador4 = ADX[14]c4= (indicador4 >= 17 OR indicador4 <= 28)IF c1 AND c2 AND c3 and c4 THENBUY 5 CONTRACT AT MARKETENDIF// Condiciones de salida de posiciones largasindicator5 = WilderAverage[8](close)c5 = (indicator5 = close)IF c5 THENSELL AT MARKETENDIF// Stops y objetivosSET STOP pLOSS 100the other conditions would be the opposite (willy <-50, price below the ema8, the smoothed average, 2 minima … etc).
For the closing of the operation I have proposed 2 systems:
– A security stop at x points.
– At the moment in which the price touches Wilder’s smoothed average, that is to say when the price = Wilder’s smoothed average of 8 periods, we do not have to wait for sail closing. The moment you make a wick and touch the stock, the operation should be closed.09/27/2018 at 10:47 AM #8142709/27/2018 at 11:23 AM #81438Try following GraHal‘s suggestion.
09/27/2018 at 11:25 AM #81439It doesn’t work
When you say it doesn’t work, do you mean it doesnt run or it doesn’t make the profit you would like? 🙂
It does run see attached results from your code.
ADX in the range between 20 and 28. If it has been below or above I do not want to open the operation.
So you need AND as below (not OR as you show in your code at Line 12).
12indicador4 = ADX[14]c4= (indicador4 >= 17 AND indicador4 <= 28)09/27/2018 at 11:37 AM #81441When I do the test, its looks like that…..
09/27/2018 at 11:39 AM #81444I have tried the GraHal‘s suggestion but it doesn’t work. I don’t know why…
09/27/2018 at 11:51 AM #81446You did not add the code to meet your condition 4 (2 previous candles above Ema 8):
1c6 = (summation[2](c1[1]) = 2)You also did not add the code to meet your condition 5 (higher high):
1c7 = high > high[1]then you can follow GraHal‘s suggetion and be winning!
Of course you’ll have to add C6 abd C7 to conditions to enter long (line 15).
09/27/2018 at 12:03 PM #81447Grazie mille Roberto but the robot doesn’t make any operation, I have changed the code with yours suggestions.
09/27/2018 at 2:09 PM #81459I think your strategy HAS entered one trade AND it is still OPEN, after more than one year!
Click on the TAB “Liste des Ordres”.
It’s because condition C5 will NEVER be true, how can a price (close) be EQUYAL to a MA? You should use “>=”, instead in line 21 and you’ll have LOTS of trades!
-
AuthorPosts
Find exclusive trading pro-tools on