Traducir de mq4 a Prt:"Relative Strength rank"
Forums › ProRealTime foro Español › Soporte ProBuilder › Traducir de mq4 a Prt:"Relative Strength rank"
- This topic has 3 replies, 2 voices, and was last updated 6 years ago by
Fr7.
Viewing 4 posts - 1 through 4 (of 4 total)
-
-
07/02/2019 at 1:51 PM #101812
Nicolás sería tan amable de traducir este código a PRT?Lo encuentro muy interesante para determinar la fortaleza de cualquier valor.
Gracias
Relative strength rank123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140//------------------------------------------------------------------////------------------------------------------------------------------#property copyright#property link#property indicator_separate_window#property indicator_buffers 6#property indicator_color1 DeepSkyBlue#property indicator_color2 DeepSkyBlue#property indicator_color3 PaleVioletRed#property indicator_color4 PaleVioletRed#property indicator_color5 DimGray#property indicator_color6 DimGray#property indicator_width1 2#property indicator_width3 2#property indicator_width5 2#property indicator_style6 STYLE_DOT//////////extern int RsrPrice = PRICE_CLOSE;extern int RsrShortPeriod = 20;extern int RsrLongPeriod = 140;extern int RsrMaMode = MODE_SMA;extern int AtrPeriod = 10;extern bool ShowHistogram = true;//////////double rsr[];double rsrHuu[];double rsrHud[];double rsrHdu[];double rsrHdd[];double zli[];//------------------------------------------------------------------////------------------------------------------------------------------//////////int init(){if (ShowHistogram)int drawStyle = DRAW_HISTOGRAM;else drawStyle = DRAW_NONE;//////////SetIndexBuffer(0,rsrHuu); SetIndexStyle(0,drawStyle);SetIndexBuffer(1,rsrHud); SetIndexStyle(1,drawStyle);SetIndexBuffer(2,rsrHdd); SetIndexStyle(2,drawStyle);SetIndexBuffer(3,rsrHdu); SetIndexStyle(3,drawStyle);SetIndexBuffer(4,rsr);SetIndexBuffer(5,zli);IndicatorShortName("Relative Strength Rank ("+RsrShortPeriod+","+RsrLongPeriod+","+AtrPeriod+")");return(0);}int deinit() { return(0); }//------------------------------------------------------------------////------------------------------------------------------------------//////////double work[][2];#define _trend 0#define _slope 1int start(){int i,r,limit,counted_bars=IndicatorCounted();if(counted_bars<0) return(-1);if(counted_bars>0) counted_bars--;limit = MathMin(Bars-counted_bars,Bars-2);if (ArrayRange(work,0)!=Bars) ArrayResize(work,Bars);//////////for(i=limit, r=Bars-i-1; i>=0; i--,r++){double price = iMA(NULL,0,1 ,0,MODE_SMA ,RsrPrice,i);double mas = iMA(NULL,0,RsrShortPeriod,0,RsrMaMode,RsrPrice,i);double mal = iMA(NULL,0,RsrLongPeriod ,0,RsrMaMode,RsrPrice,i);double atr = iATR(NULL,0,AtrPeriod,i);if (atr!=0)rsr[i] = (price-mas+price-mal)/(2.0*atr);else rsr[i] = 0;//////////zli[i] = 0;rsrHuu[i] = EMPTY_VALUE;rsrHud[i] = EMPTY_VALUE;rsrHdu[i] = EMPTY_VALUE;rsrHdd[i] = EMPTY_VALUE;work[r][_slope] = work[r-1][_slope];if (rsr[i]>rsr[i+1]) work[r][_slope] = 1;if (rsr[i]<rsr[i+1]) work[r][_slope] = -1;if (rsr[i]>0)if (work[r][_slope]==1)rsrHuu[i] = rsr[i];else rsrHud[i] = rsr[i];if (rsr[i]<0)if (work[r][_slope]==-1)rsrHdd[i] = rsr[i];else rsrHdu[i] = rsr[i];}return(0);}07/06/2019 at 3:53 PM #10205307/08/2019 at 9:48 AM #102137Codifiqué el indicador, puede descargarlo aquí: Indicador de Rango de Fuerza Relativa
1 user thanked author for this post.
07/08/2019 at 12:36 PM #102162 -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
Find exclusive trading pro-tools on
Similar topics: