Code Conversion Easy Language to Pro Real Time
Forums › ProRealTime English forum › ProBuilder support › Code Conversion Easy Language to Pro Real Time
- This topic has 4 replies, 2 voices, and was last updated 1 year ago by JS.
Viewing 5 posts - 1 through 5 (of 5 total)
-
-
07/07/2023 at 2:16 PM #217407
I have about 10-15 premarket and postmarket functions from Easy Language (TradeStation) that I’d like to convert to Pro Real Time so I can continue to support Pro Real Time. I am hard pressed for time and looking for community (or private) help. Please contact me if interested!
07/07/2023 at 2:18 PM #2174081234567891011121314// PrePostMarketMaxinput: start_time ( numeric ), // 1600end_time ( numeric ) // 930 EST;if time >= start_time and time[1] < start_time then beginvalue1 = close;end;if time > start_time or time <= end_time thenvalue2 = iff(value1 <> 0, (close/value1 - 1) * 100, 0);PrePostMarketMax = value2;07/08/2023 at 7:04 AM #217430PrePostMarketMax123456789101112131415161718// PrePostMarketMaxStartTime = 160000 // 1600EndTime = 093000 // 930 ESTIf time >= StartTime and time[1] < StartTime thenvalue1 = closeEndIfif time > StartTime or time <= EndTime thenIf value1 <> 0 thenvalue2 = (close/value1 - 1) * 100EndIfEndIfPrePostMarketMax = value2Return PrePostMarketMax07/08/2023 at 11:20 AM #217439Thank you. It is as I suspected. I can manage most very quickly, but can you assist with this one?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110using elsystem;using elsystem.collections;inputs: Start_time (numeric ), // 0401End_time ( numeric ) , // 930Length ( numeric ) ; // 10{Vars: Start_time(0401),End_time(0930),Length(10);}Vars: double AnyVol(0),double TodayVol(0),double AvgDayVol(0), double DayRatio(0),double AvgTimeVol(0), double TimeRatio(0),Vector volVect(null),Vector timeVect(null),Dictionary timeDict(null),int counter(0),int xx(0),IntrabarPersist FirstTickOfBar(false);once beginvolVect = new Vector;timeVect = new Vector;timeDict = new Dictionary;for xx = 0 to Length-1 beginvolVect.push_back(0 astype double);end;end;//Work out this bar's volumeif BarType >= 2 and BarType < 5 then begin { Daily, Weekly, or Monthly bars }AnyVol = Volume;endelse beginAnyVol = Ticks;end;//if time = Start_time and ( time[1] < Start_time or date <> date[1] ) then begin//Save yesterday's volumeVolVect[counter] = TodayVol astype double;//Update the position of the vector. Circle back to 0 if greater than length.counter = counter + 1;if counter >= Length then counter = 0;//Find the average of the vectorAvgDayVol = VectorAverage(volVect, Length);end;//Reset our running volume countif time = Start_time and ( time[1] < Start_time or date <> date[1] ) then beginTodayVol = 0;end;//Running volumeif time >= Start_time and time <= End_time then beginTodayVol = TodayVol + AnyVol;end;if BarStatus(1) = 2 and time >= Start_time and time <= End_time then beginif timeDict.Contains(NumToStr(time, 0)) then begintimeVect = timeDict.Items[NumToStr(time, 0)] astype Vector;endelse beginfor xx = 0 to Length-1 begintimeVect.push_back(0 astype double);end;timeDict.Add(NumToStr(time, 0), timeVect astype Vector);end;//Find the average of the vectorAvgTimeVol = VectorAverage(timeVect, Length);timeVect[counter] = TodayVol astype double;timeDict.Items[NumToStr(time, 0)] = timeVect astype Vector;timeVect = new Vector;end;if AvgDayVol > 0 then beginDayRatio = TodayVol/AvgDayVol;endelse beginDayRatio = 0;end;if AvgTimeVol > 0 then beginTimeRatio = TodayVol/AvgTimeVol;endelse beginTimeRatio = 0;end;FirstTickOfBar = BarStatus(1) = 2;PreMarketRelativeVolume = DayRatio;07/08/2023 at 11:53 AM #217440 -
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
Find exclusive trading pro-tools on
Similar topics: