Posted By: Chuate
I want to get the maximum value - 01/07/19 15:45
Hello, I want to get the maximum value but the result is so weird. Do you know what is problem ? I can use MaxVal function but I want to use my own function
recent_max_H:5835419512674041400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000
recent_max_H:5835419512674041400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000
Code:
var test(var *Highs, int Period) { int count; var recent_max_H = 0; for(count = 1; count < Period; count++) { if (Highs[count] > recent_max_H) recent_max_H = Highs[count]; } printf("nrecent_max_H:%f", recent_max_H); return 1; } function run() { set(PLOTNOW|PARAMETERS); StartDate = 20180705; EndDate = 20180705; BarPeriod = 60; LookBack = 3; // create series of highs, closes, lows vars Highs = series(priceHigh()); int Period_Bar = 50; if (test(Highs, Period_Bar) == 1) { enterLong(); } }