SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sun Oct 21, 2018 1:50 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Dec 31, 2012 9:26 am 
Offline

Joined: Mon Nov 12, 2012 2:38 am
Posts: 59
I hope the HighestHigh and LowestLow function could be changed to this style
Highest(...,BarData data, ...)
So that I can find the highest close by using Highest(..., BarData.Close, ...)
or the highest open by using Highest(..., BarData.Open, ...)

it gets more flexible...


Top
 Profile  
 
PostPosted: Thu Jan 03, 2013 9:52 am 
Offline

Joined: Mon Nov 12, 2012 2:38 am
Posts: 59
Frequently, people need to know where the highest bar is, so I suggest add some more member functions to BarSeries
for example
IndexOfHighest(BarData.Close) return the index where has the highest close price
and
TimeOfHighest(BarData.High) return the time where has the highest high price


Top
 Profile  
 
PostPosted: Thu Jan 03, 2013 4:27 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6808
Hi,

thanks for your suggestions. We will try to add these methods when we are back to office after Christmas holidays (7th of January is Christmas in Russia).

Regards,
Anton


Top
 Profile  
 
PostPosted: Fri Jan 04, 2013 8:58 am 
Offline

Joined: Mon Nov 12, 2012 2:38 am
Posts: 59
Thanks for your response. Since people always focus more on the recent data, I think it is also useful to get the highest between latest bars with reverse index N1 and N2(), so I also suggest to add methods

IndexOfHighest(..., BarData.High, N1, N2 ) // bars with foward numbering
IndexOfLatestHighest(..., BarData.High, N1, N2 ) // bars with reverse numbering


Top
 Profile  
 
PostPosted: Wed Feb 06, 2013 1:28 pm 
Offline

Joined: Mon Nov 12, 2012 2:38 am
Posts: 59
I coded some functions for my convenience, please take it as a new suggest.

public class SeriesMark
{
public double Value;
public int Index;
public DateTime DateTime;
}

public static SeriesMark LastMax(BarSeries series, BarData Type, int N1, int N2)
{
SeriesMark mark = new SeriesMark();
int NS = series.Count - 1;
double tmp = double.MinValue;
for (int n = N1; n <= N2; n++)
{
if (tmp < series[NS - n, Type])
{
tmp = series[NS - n, Type];
mark.Value = tmp;
mark.Index = n;
mark.DateTime = series[NS - n].DateTime;
}
}
return mark;
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group