Advertisement
Genpro

correl8

Feb 8th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.85 KB | None | 0 0
  1. //+------------------------------------------------------------------+
  2. //| Correl8.mq4 |
  3. //| Copyright 2014, MetaQuotes Software Corp. |
  4. //| http://www.mql5.com |
  5. //+------------------------------------------------------------------+
  6. #property copyright "Copyright 2014, MetaQuotes Software Corp."
  7. #property link "http://www.mql5.com"
  8. #property version "1.00"
  9. #property strict
  10. #property indicator_separate_window
  11. #property indicator_buffers 9
  12. #property indicator_color1 clrRoyalBlue
  13. #property indicator_color2 clrSilver
  14. #property indicator_color3 clrDarkOrange
  15. #property indicator_color4 clrDarkViolet
  16. #property indicator_color5 clrFireBrick
  17. #property indicator_color6 clrMagenta
  18. #property indicator_color7 clrYellow
  19. #property indicator_color8 clrLimeGreen
  20. #property indicator_color9 clrGold
  21.  
  22. #property indicator_width1 2
  23. #property indicator_width2 2
  24. #property indicator_width3 2
  25. #property indicator_width4 2
  26. #property indicator_width5 2
  27. #property indicator_width6 2
  28. #property indicator_width7 2
  29. #property indicator_width8 3
  30. #property indicator_width9 3
  31.  
  32. #property indicator_level1 -50
  33. #property indicator_level2 -26
  34. #property indicator_level3 -12
  35. #property indicator_level4 0
  36. #property indicator_level5 12
  37. #property indicator_level6 26
  38. #property indicator_level7 50
  39. #property indicator_levelcolor clrLightSlateGray
  40. //+------------------------------------------------------------------+
  41. //| |
  42. //+------------------------------------------------------------------+
  43. enum ENUM_RANGEMODE
  44. {
  45. HIGH_LOW,
  46. CLOSE_CLOSE,
  47. HIGH_LOW_CLOSE,
  48. };
  49. // Indicator parameters
  50. extern int iPRIPeriod=14;
  51. input ENUM_APPLIED_PRICE iPrice = PRICE_CLOSE;
  52. input ENUM_RANGEMODE RangeMode = HIGH_LOW;
  53. input ENUM_TIMEFRAMES TimeFrame = 0;
  54. input int TriggerCandle = 1;
  55. input bool EnableNativeAlerts = true;
  56. input bool EnableSoundAlerts = true;
  57. input bool EnableEmailAlerts = true;
  58. input bool EnablePushAlerts = true;
  59. input string AlertEmailSubject = "";
  60. input string AlertText = "";
  61. input string SoundFileName = "alert.wav";
  62.  
  63. datetime LastAlertTime = D'01.01.1970';
  64. int LastAlertDirection = 0;
  65. // Show currencies on chart
  66. extern bool ShowAuto=true;
  67. // Show all currencies
  68. extern bool ShowAll = false;
  69. extern bool ShowEUR = false;
  70. extern bool ShowGBP = false;
  71. extern bool ShowAUD = false;
  72. extern bool ShowNZD = false;
  73. extern bool ShowCHF = false;
  74. extern bool ShowCAD = false;
  75. extern bool ShowJPY = false;
  76. extern bool ShowUSD = false;
  77. extern bool ShowXAU = false;
  78. //---index buffers for drawing
  79. double Idx1[],Idx2[],Idx3[],Idx4[],Idx5[],Idx6[],Idx7[],Idx8[],Idx9[];
  80. //---currency variables for calculation
  81. double EUR,GBP,AUD,NZD,CHF,CAD,JPY,USD,XAU;
  82. double EURUSD,GBPUSD,AUDUSD,NZDUSD,/*USDCHF,USDCAD,USDJPY,*/XAUUSD;
  83. //---currency names and colors
  84. string Currencies[indicator_buffers]=
  85. {
  86. "EUR","GBP","AUD","NZD",
  87. "CHF","CAD","JPY","USD","XAU"
  88. };
  89. string ShortName;
  90. int BarsWindow;
  91. //+------------------------------------------------------------------+
  92. //| Custom indicator initialization function |
  93. //+------------------------------------------------------------------+
  94. int OnInit()
  95. {
  96. //---
  97. IndicatorDigits(0);
  98. IndicatorBuffers(indicator_buffers);
  99. BarsWindow=WindowBarsPerChart()+iPRIPeriod;
  100. //---set timeframes
  101. /* if(TimeFrame==0)
  102. {
  103. switch(Period())
  104. {
  105. case PERIOD_M30: iPRIPeriod*=2;break;
  106. case PERIOD_M15: iPRIPeriod*=4;break;
  107. case PERIOD_M5: iPRIPeriod*=12;break;
  108. case PERIOD_M1: iPRIPeriod*=60;break;
  109. }
  110. }
  111. if(TimeFrame>0)
  112. {
  113. switch(TimeFrame)
  114. {
  115. case PERIOD_M30: iPRIPeriod*=2;break;
  116. case PERIOD_M15: iPRIPeriod*=4;break;
  117. case PERIOD_M5: iPRIPeriod*=12;break;
  118. case PERIOD_M1: iPRIPeriod*=60;break;
  119. }
  120. }*/
  121. string sTimeFrame;
  122. switch(TimeFrame)
  123. {
  124. case PERIOD_MN1: sTimeFrame = "MN1 ";break;
  125. case PERIOD_W1: sTimeFrame = "W1 "; break;
  126. case PERIOD_D1: sTimeFrame = "D1 "; break;
  127. case PERIOD_H4: sTimeFrame = "H4 "; break;
  128. case PERIOD_H1: sTimeFrame = "H1 "; break;
  129. case PERIOD_M30: sTimeFrame = "M30 ";break;
  130. case PERIOD_M15: sTimeFrame = "M15 ";break;
  131. case PERIOD_M5: sTimeFrame = "M5 "; break;
  132. case PERIOD_M1: sTimeFrame = "M1 "; break;
  133. default: sTimeFrame = ""; break;
  134. }
  135. ShortName="iCorrel8 "+sTimeFrame+"("+IntegerToString(iPRIPeriod)+") ";
  136. IndicatorShortName(ShortName);
  137. //---currencies to show
  138. if(ShowAuto)
  139. {
  140. string Quote= StringSubstr(Symbol(),3,3); //Quote currency name
  141. string Base = StringSubstr(Symbol(),0,3); //Base currency name
  142. if(Quote == "EUR" || Base == "EUR") ShowEUR = true;
  143. if(Quote == "GBP" || Base == "GBP") ShowGBP = true;
  144. if(Quote == "AUD" || Base == "AUD") ShowAUD = true;
  145. if(Quote == "NZD" || Base == "NZD") ShowNZD = true;
  146. if(Quote == "CHF" || Base == "CHF") ShowCHF = true;
  147. if(Quote == "CAD" || Base == "CAD") ShowCAD = true;
  148. if(Quote == "JPY" || Base == "JPY") ShowJPY = true;
  149. if(Quote == "USD" || Base == "USD") ShowUSD = true;
  150. if(Quote == "XAU" || Base == "XAU") ShowXAU = true;
  151. //ShowAll=false;
  152. }
  153.  
  154. if(ShowAll)
  155. {
  156. //ShowAuto = false;
  157. ShowEUR = true;
  158. ShowGBP = true;
  159. ShowAUD = true;
  160. ShowNZD = true;
  161. ShowCHF = true;
  162. ShowCAD = true;
  163. ShowJPY = true;
  164. ShowUSD = true;
  165. ShowXAU = true;
  166. }
  167.  
  168. int window=WindowFind(ShortName);
  169. int xStart=4; //label coordinates
  170. int xIncrement=25;
  171. int yStart=16;
  172. //---set buffer properties
  173. if(ShowEUR)
  174. {
  175. SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,indicator_width1);
  176. SetIndexLabel(0,Currencies[0]);
  177. SetIndexDrawBegin(0,iPRIPeriod);
  178. CreateLabel(Currencies[0],window,xStart,yStart,indicator_color1);
  179. xStart+=xIncrement;
  180. }
  181. if(ShowGBP)
  182. {
  183. SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,indicator_width2);
  184. SetIndexLabel(1,Currencies[1]);
  185. SetIndexDrawBegin(1,iPRIPeriod);
  186. CreateLabel(Currencies[1],window,xStart,yStart,indicator_color2);
  187. xStart+=xIncrement;
  188. }
  189. if(ShowAUD)
  190. {
  191. SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,indicator_width3);
  192. SetIndexLabel(2,Currencies[2]);
  193. SetIndexDrawBegin(2,iPRIPeriod);
  194. CreateLabel(Currencies[2],window,xStart,yStart,indicator_color3);
  195. xStart+=xIncrement;
  196. }
  197. if(ShowNZD)
  198. {
  199. SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,indicator_width4);
  200. SetIndexDrawBegin(3,iPRIPeriod);
  201. SetIndexLabel(3,Currencies[3]);
  202. CreateLabel(Currencies[3],window,xStart,yStart,indicator_color4);
  203. xStart+=xIncrement;
  204. }
  205. if(ShowCHF)
  206. {
  207. SetIndexStyle(4,DRAW_LINE,STYLE_SOLID,indicator_width5);
  208. SetIndexLabel(4,Currencies[4]);
  209. SetIndexDrawBegin(4,iPRIPeriod);
  210. CreateLabel(Currencies[4],window,xStart,yStart,indicator_color5);
  211. xStart+=xIncrement;
  212. }
  213. if(ShowCAD)
  214. {
  215. SetIndexStyle(5,DRAW_LINE,STYLE_SOLID,indicator_width6);
  216. SetIndexLabel(5,Currencies[5]);
  217. SetIndexDrawBegin(5,iPRIPeriod);
  218. CreateLabel(Currencies[5],window,xStart,yStart,indicator_color6);
  219. xStart+=xIncrement;
  220. }
  221. if(ShowJPY)
  222. {
  223. SetIndexStyle(6,DRAW_LINE,STYLE_SOLID,indicator_width7);
  224. SetIndexLabel(6,Currencies[6]);
  225. SetIndexDrawBegin(6,iPRIPeriod);
  226. CreateLabel(Currencies[6],window,xStart,yStart,indicator_color7);
  227. xStart+=xIncrement;
  228. }
  229. if(ShowUSD)
  230. {
  231. SetIndexStyle(7,DRAW_LINE,STYLE_SOLID,indicator_width8);
  232. SetIndexLabel(7,Currencies[7]);
  233. SetIndexDrawBegin(7,iPRIPeriod);
  234. CreateLabel(Currencies[7],window,xStart,yStart,indicator_color8);
  235. xStart+=xIncrement;
  236. }
  237. if(ShowXAU)
  238. {
  239. SetIndexStyle(8,DRAW_LINE,STYLE_SOLID,indicator_width9);
  240. SetIndexLabel(8,Currencies[8]);
  241. SetIndexDrawBegin(8,iPRIPeriod);
  242. CreateLabel(Currencies[8],window,xStart,yStart,indicator_color9);
  243. //xStart+=xIncrement;
  244. }
  245. //---index buffers
  246. SetIndexBuffer(0,Idx1);
  247. SetIndexBuffer(1,Idx2);
  248. SetIndexBuffer(2,Idx3);
  249. SetIndexBuffer(3,Idx4);
  250. SetIndexBuffer(4,Idx5);
  251. SetIndexBuffer(5,Idx6);
  252. SetIndexBuffer(6,Idx7);
  253. SetIndexBuffer(7,Idx8);
  254. SetIndexBuffer(8,Idx9);
  255. //---
  256. return(INIT_SUCCEEDED);
  257. }
  258. //+------------------------------------------------------------------+
  259. //| Custom indicator deinitialization function |
  260. //+------------------------------------------------------------------+
  261. void OnDeinit(const int reason)
  262. {
  263. // delete labels
  264. //int window=WindowFind(ShortName);
  265. for(int i=0;i<indicator_buffers;i++)
  266. ObjectDelete(Currencies[i]);
  267. return;
  268. }
  269. //+------------------------------------------------------------------+
  270. //| Custom indicator iteration function |
  271. //+------------------------------------------------------------------+
  272. int OnCalculate(const int rates_total,
  273. const int prev_calculated,
  274. const datetime &time[],
  275. const double &open[],
  276. const double &high[],
  277. const double &low[],
  278. const double &close[],
  279. const long &tick_volume[],
  280. const long &volume[],
  281. const int &spread[])
  282. {
  283. //---
  284. BarsWindow=WindowBarsPerChart()+iPRIPeriod;
  285. int shift;
  286. int limit=rates_total-prev_calculated;
  287. if(prev_calculated==0) limit=BarsWindow;
  288. if(prev_calculated>0) limit++;
  289. if(prev_calculated>0 && NewBar()) limit++;
  290. for(int i=0; i<limit; i++)
  291. {
  292. shift=iBarShift(NULL,TimeFrame,time[i]);
  293.  
  294. EUR = iPRI("EURUSD",TimeFrame,iPRIPeriod,iPrice,shift);
  295. GBP = iPRI("GBPUSD",TimeFrame,iPRIPeriod,iPrice,shift);
  296. AUD = iPRI("AUDUSD",TimeFrame,iPRIPeriod,iPrice,shift);
  297. NZD = iPRI("NZDUSD",TimeFrame,iPRIPeriod,iPrice,shift);
  298. CHF = iPRI("USDCHF",TimeFrame,iPRIPeriod,iPrice,shift);
  299. CAD = iPRI("USDCAD",TimeFrame,iPRIPeriod,iPrice,shift);
  300. JPY = iPRI("USDJPY",TimeFrame,iPRIPeriod,iPrice,shift);
  301. XAU = iPRI("XAUUSD",TimeFrame,iPRIPeriod,iPrice,shift);
  302.  
  303. EURUSD = iClose("EURUSD",TimeFrame,shift); //Get USD ratio
  304. GBPUSD = iClose("GBPUSD",TimeFrame,shift);
  305. AUDUSD = iClose("AUDUSD",TimeFrame,shift);
  306. NZDUSD = iClose("NZDUSD",TimeFrame,shift);
  307. //USDCHF = iClose("USDCHF",TimeFrame,shift);
  308. //USDCAD = iClose("USDCAD",TimeFrame,shift);
  309. //USDJPY = iClose("USDJPY",TimeFrame,shift)/100;
  310. XAUUSD = iClose("XAUUSD",TimeFrame,shift)/1000;
  311.  
  312. if(EURUSD)
  313. EUR*=1/EURUSD;
  314. if(GBPUSD)
  315. GBP*=1/GBPUSD;
  316. if(AUDUSD)
  317. AUD*=1/AUDUSD;
  318. if(NZDUSD)
  319. NZD*=1/NZDUSD;
  320. if(XAUUSD)
  321. XAU*=1/XAUUSD;
  322.  
  323. CHF*=-1;
  324. CAD*=-1;
  325. JPY*=-1;
  326.  
  327. USD=-(EUR+GBP+AUD+NZD+CHF+CAD+JPY+XAU)/(indicator_buffers-1); //USD relative to other
  328. /*EUR += -(GBP + AUD + NZD + CHF + CAD + JPY + XAU)/(indicator_buffers-2); //Currency relative to USD
  329. GBP += -(EUR + AUD + NZD + CHF + CAD + JPY + XAU)/(indicator_buffers-2);
  330. AUD += -(EUR + GBP + NZD + CHF + CAD + JPY + XAU)/(indicator_buffers-2);
  331. NZD += -(EUR + GBP + AUD + CHF + CAD + JPY + XAU)/(indicator_buffers-2);
  332. CHF += -(EUR + GBP + AUD + NZD + CAD + JPY + XAU)/(indicator_buffers-2);
  333. CAD += -(EUR + GBP + AUD + NZD + CHF + JPY + XAU)/(indicator_buffers-2);
  334. JPY += -(EUR + GBP + AUD + NZD + CHF + CAD + XAU)/(indicator_buffers-2);
  335. */
  336. if(ShowEUR)
  337. Idx1[i]=EUR;
  338. if(ShowGBP)
  339. Idx2[i]=GBP;
  340. if(ShowAUD)
  341. Idx3[i]=AUD;
  342. if(ShowNZD)
  343. Idx4[i]=NZD;
  344. if(ShowCHF)
  345. Idx5[i]=CHF;
  346. if(ShowCAD)
  347. Idx6[i]=CAD;
  348. if(ShowJPY)
  349. Idx7[i]=JPY;
  350. if(ShowUSD)
  351. Idx8[i]=USD;
  352. if(ShowXAU)
  353. Idx9[i]=XAU;
  354. }
  355. //--- return value of prev_calculated for next call
  356. (if (((rates_total — 1 — TriggerCandle > 0) && (time[rates_total — 1] > LastAlertTime)) || (rates_total — 1 — TriggerCandle == 0))
  357. {
  358. string Text;
  359. // Up-Line Crosses Down-Line from Below
  360. if (((TriggerCandle > 0) && (time[rates_total — 1] > LastAlertTime)) || (TriggerCandle == 0))
  361. {
  362. string Text;
  363. // Up-Line Crosses Down-Line from Below
  364. if (((Idx1[TriggerCandle] > Idx8[TriggerCandle]) && (Idx1[TriggerCandle+ 1] <= Idx8[TriggerCandle+ 1])) && ((TriggerCandle > 0) || ((TriggerCandle == 0) && (LastAlertDirection != 1))))
  365. {
  366. Text = AlertText + "EUR USD: " + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - Up-Line Crosses Down-Line from Below.";
  367. if (EnableNativeAlerts) Alert(Text);
  368. if (EnableEmailAlerts) SendMail(AlertEmailSubject + "EUR USD Alert", Text);
  369. if (EnableSoundAlerts) PlaySound(SoundFileName);
  370. if (EnablePushAlerts) SendNotification(Text);
  371. LastAlertTime = time[rates_total — 1];
  372. LastAlertDirection = 1;
  373. }
  374. // Up-Line Crosses Down-Line from Above
  375. if (((Idx1[TriggerCandle] < Idx8[TriggerCandle]) && (Idx1[TriggerCandle+ 1] >= Idx8[TriggerCandle+ 1])) && ((TriggerCandle > 0) || ((TriggerCandle == 0) && (LastAlertDirection != -1))))
  376. {
  377. Text = AlertText + "EUR USD: " + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - Up-Line Crosses Down-Line from Above.";
  378. if (EnableNativeAlerts) Alert(Text);
  379. if (EnableEmailAlerts) SendMail(AlertEmailSubject + "EUR USD Alert", Text);
  380. if (EnableSoundAlerts) PlaySound(SoundFileName);
  381. if (EnablePushAlerts) SendNotification(Text);
  382. LastAlertTime = time[rates_total — 1];
  383. LastAlertDirection = -1;
  384. }
  385. return(rates_total);
  386. }
  387. //+------------------------------------------------------------------+
  388. //+------------------------------------------------------------------+
  389. //| |
  390. //+------------------------------------------------------------------+
  391. void CreateLabel(string currency,
  392. int window,
  393. int x,
  394. int y,
  395. int clr)
  396. {
  397. int label=ObjectCreate(currency,OBJ_LABEL,window,0,0);
  398. ObjectSetText(currency,currency,8);
  399. ObjectSet(currency,OBJPROP_COLOR,clr);
  400. ObjectSet(currency,OBJPROP_XDISTANCE,x);
  401. ObjectSet(currency,OBJPROP_YDISTANCE,y);
  402. }
  403. //+------------------------------------------------------------------+
  404. //| |
  405. //+------------------------------------------------------------------+
  406. bool NewBar()
  407. {
  408. static datetime time_prev;
  409. if(iTime("EURUSD",TimeFrame,0) != time_prev &&
  410. iTime("GBPUSD",TimeFrame,0) != time_prev &&
  411. iTime("AUDUSD",TimeFrame,0) != time_prev &&
  412. iTime("NZDUSD",TimeFrame,0) != time_prev &&
  413. iTime("USDCHF",TimeFrame,0) != time_prev &&
  414. iTime("USDCAD",TimeFrame,0) != time_prev &&
  415. iTime("USDJPY",TimeFrame,0) != time_prev &&
  416. iTime("XAUUSD",TimeFrame,0) != time_prev)
  417. {
  418. time_prev = iTime("EURUSD",TimeFrame,0);
  419. time_prev = iTime("GBPUSD",TimeFrame,0);
  420. time_prev = iTime("AUDUSD",TimeFrame,0);
  421. time_prev = iTime("NZDUSD",TimeFrame,0);
  422. time_prev = iTime("USDCHF",TimeFrame,0);
  423. time_prev = iTime("USDCAD",TimeFrame,0);
  424. time_prev = iTime("USDJPY",TimeFrame,0);
  425. time_prev = iTime("XAUUSD",TimeFrame,0);
  426. return(true);
  427. }
  428. return(false);
  429. }
  430. //+------------------------------------------------------------------+
  431. //| Percent Range Index Function |
  432. //+------------------------------------------------------------------+
  433. const int iPRI(const string symbol,
  434. const ENUM_TIMEFRAMES timeframe,
  435. const int period,
  436. const ENUM_APPLIED_PRICE price,
  437. const int idx)
  438. {
  439. int PRI;
  440. double Price;
  441. double Range;
  442. double MaxHigh;
  443. double MinLow;
  444. double HighHigh;
  445. double HighClose;
  446. double HighLow;
  447. double LowHigh;
  448. double LowClose;
  449. double LowLow;
  450.  
  451. switch(RangeMode)
  452. {
  453. case HIGH_LOW:
  454. {
  455. MaxHigh=iHigh(symbol,timeframe,
  456. iHighest(symbol,timeframe,MODE_HIGH,period,idx));
  457. MinLow=iLow(symbol,timeframe,
  458. iLowest(symbol,timeframe,MODE_LOW,period,idx));
  459. break;
  460. }
  461. case CLOSE_CLOSE:
  462. {
  463. MaxHigh=iClose(symbol,timeframe,
  464. iHighest(symbol,timeframe,MODE_CLOSE,period,idx));
  465. MinLow=iClose(symbol,timeframe,
  466. iLowest(symbol,timeframe,MODE_CLOSE,period,idx));
  467. break;
  468. }
  469. case HIGH_LOW_CLOSE:
  470. {
  471. HighHigh=iHigh(symbol,timeframe,
  472. iHighest(symbol,timeframe,MODE_HIGH,period,idx));
  473. HighClose=iClose(symbol,timeframe,
  474. iHighest(symbol,timeframe,MODE_CLOSE,period,idx));
  475. HighLow=iLow(symbol,timeframe,
  476. iHighest(symbol,timeframe,MODE_LOW,period,idx));
  477. LowHigh=iHigh(symbol,timeframe,
  478. iLowest(symbol,timeframe,MODE_HIGH,period,idx));
  479. LowClose=iClose(symbol,timeframe,
  480. iLowest(symbol,timeframe,MODE_CLOSE,period,idx));
  481. LowLow=iLow(symbol,timeframe,
  482. iLowest(symbol,timeframe,MODE_LOW,period,idx));
  483. MaxHigh=(HighHigh+HighClose+HighLow)/3;
  484. MinLow =(LowHigh+LowClose+LowLow)/3;
  485. break;
  486. }
  487. }
  488.  
  489. switch(price)
  490. {
  491. case PRICE_CLOSE: Price = iClose(symbol,timeframe,idx); break;
  492. case PRICE_HIGH: Price = iHigh(symbol,timeframe,idx); break;
  493. case PRICE_LOW: Price = iLow(symbol,timeframe,idx); break;
  494. case PRICE_MEDIAN: Price =(iHigh(symbol,timeframe,idx)+
  495. iLow(symbol,timeframe,idx))/2; break;
  496. case PRICE_TYPICAL: Price =(iHigh(symbol,timeframe,idx)+
  497. iLow(symbol,timeframe,idx)+
  498. iClose(symbol,timeframe,idx))/3; break;
  499. case PRICE_WEIGHTED: Price =(iHigh(symbol,timeframe,idx)+
  500. iLow(symbol,timeframe,idx)+
  501. iClose(symbol,timeframe,idx)+
  502. iClose(symbol,timeframe,idx))/4; break;
  503. default: Price = iClose(symbol,timeframe,idx);
  504. }
  505.  
  506. Range=MaxHigh-MinLow;
  507.  
  508. if(NormalizeDouble(Range,3)!=0.0)
  509. {
  510. PRI=100*(Price-MinLow)/Range;
  511. PRI-=50;
  512. }
  513. else PRI=0;
  514. //if(PRI > 50) PRI = 50;
  515. //if(PRI < -50) PRI = -50;
  516. return(PRI);
  517. }
  518. //+------------------------------------------------------------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement