Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 3/20/2006(UTC) Posts: 53
|
Hi.
I'm a beginner in writing an explorer.
How can I make an explorer which looks for the following:
- the rate of change within a custom period
- the ratio of white candles and black candles within a custom period
- the ratio of rising days (ie open low; close high) and falling days within a custom period
- the ratio of high-closing days (ie today's close higher than previous close) and low-closing days within a custom period
???
Thanks so much for your help! :D
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 9/13/2004(UTC) Posts: 673 Location: Salt Lake City, UT
|
You can use variables to more easily modify custom values.
Column A
X:=10;
RoC(C,X,$)
Column B
X:=10;
Sum(C>O,X)/Sum(C<O,X)
Isn't rising days and falling days the same as hollow and solid candles?
Column C
X:=10;
Sum(C>Ref(C,-1),X)/Sum(C<Ref(C,-1),X)
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 3/20/2006(UTC) Posts: 53
|
Pyradius wrote:
Isn't rising days and falling days the same as hollow and solid candles?
Yes, you are right!
Thanks for resolving my questions!
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 3/20/2006(UTC) Posts: 53
|
Pyradius wrote:
Column B
X:=10;
Sum(C>O,X)/Sum(C<O,X)
Column C
X:=10;
Sum(C>Ref(C,-1),X)/Sum(C<Ref(C,-1),X)
Is it possible to dislay the answer in ratio, rather than just a figure?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 9/13/2004(UTC) Posts: 673 Location: Salt Lake City, UT
|
I don't know of a way to display a ratio, but you could just use a column for each one rather than actually dividing them together...
Column A (Column Name: White)
X:=10;
Sum(C>O,X)
Column B (Column Name: Black)
X:=10;
Sum(C<O,X)
Column C (Above)
X:=10;
Sum(C>Ref(C,-1),X)
Column D (Below)
X:=10;
Sum(C<Ref(C,-1),X)
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
What about something like this?
Column E (Ratio)
X:=10;
Above:=Sum(C>Ref(C,-1),X);
Below:=Sum(C<Ref(C,-1),X);
Above/Below
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 3/20/2006(UTC) Posts: 53
|
But it is still displayed as one figure, not a ratio like 2:1
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Fractions, ratios and float/double numbers are effectively the same. Instead of rebuilding a wheel and trying to make the code more complicated than it needs to be, learn to read numbers for what they are....
10:1 == 10.0000
2:1 == 2.0000
1:8 == 0.1250
1:10 == 0.1000
they are all just numbers.
wabbit :D
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 3/20/2006(UTC) Posts: 53
|
The problem is there's more than 1 combination which can reach the same figure!
Anyway, Pyradius has provided the workaround to solve my problem! :D
Thanks, Pyradius! =D>
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Quote:The problem is there's more than 1 combination which can reach the same figure!
How exactly is that??? Post your own code for us to follow through with and a list of the securities that you are using. Restate your exact problem. I don't really understand what it is that you are asking; it appears that your question has been answered a couple of ways already. In the end, the forum is a peer-to-peer support network which starts with you. Make sure you have completed the Formula Primer and training videos in that sense. Please read the forum rules too.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 3/20/2006(UTC) Posts: 53
|
g_stockman wrote:Quote:The problem is there's more than 1 combination which can reach the same figure!
How exactly is that??? Post your own code for us to follow through with and a list of the securities that you are using. Restate your exact problem. I don't really understand what it is that you are asking; it appears that your question has been answered a couple of ways already. In the end, the forum is a peer-to-peer support network which starts with you. Make sure you have completed the Formula Primer and training videos in that sense. Please read the forum rules too.
Sorry for my poor elaboration.
What I mean is:
- a number of, say, 0.5 can be 2:1, 4:2, 8:4, 6:3 and so on - Different combinations to reach the same number!
- I prefer to seeing the ratio instead of just a number. This provides more information than just a number.
That's my points!
Got it?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 3/20/2006(UTC) Posts: 53
|
Although I couldn't find a way to display the answer in ratio, I still mark the question as resolved since most of the problems have been solved.
Thanks for everyone who tried to help me.
Thank you! :)
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
If you want the raw numbers side by side then you can use the numbers in the 'Above' column beside the numbers in the 'Below' column. Otherwise, when you divide the figures you will get a denominator of 1 and your ratio will be expressed as [censored]:1; not xx:2 or xx:4, etc.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
WmWaster wrote:Pyradius wrote:Column B
X:=10;
Sum(C>O,X)/Sum(C<O,X)
Column C
X:=10;
Sum(C>Ref(C,-1),X)/Sum(C<Ref(C,-1),X)
Is it possible to dislay the answer in ratio, rather than just a figure?
As George has suggested above, the answer to your question is "yes".
Try this:
[code:1:d554366944]
Column A: numerator1
X:=10;
Sum(C>O,X)
Column B: denominator1
X:=10;
Max(Sum(C<O,X),1)
Column C: numerator2
X:=10;
Sum(C>Ref(C,-1),X)
Column D: denominator2
X:=10;
Max(Sum(C<Ref(C,-1),X),1)
[/code:1:d554366944]
jose '-)
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.