[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EquisMetaStock Group] Coding an exploration and expert advisor.



PureBytes Links

Trading Reference Links

Sharad-

Take a look at the valuewhen function. From the online help file:

#########################################################
SYNTAX      valuewhen ( Nth, EXPRESSION, DATA ARRAY ) 

FUNCTION      Returns the value of the DATA ARRAY when the EXPRESSION 
was true on the Nth most recent occurrence. This includes all data 
loaded in the chart.

EXAMPLE      The formula "valuewhen( 2, cross(c,mov(c,10,s), rsi
(20) )" returns the value of the RSI on the 2nd most recent 
occurrence of the closing price crossing above its 10-day moving 
average. 

################################################################

If

MyBottom:= L < Trough(1,L,5) and
Trough(1,L,5) < Trough(2,L,5) AND
REF(RSI(14),-TroughBARS(1,L,5)) > REF(RSI(14),-TroughBARS(2,L,5));

then

Valuewhen(2,MyBottom,MyRSI) should return the RSI at the earlier 
bottom.

and

Valuewhen(1,MyBottom,MyRSI)

The most recent bottom.

You can assign each of the above expressions to a variable or use 
them as is for comparisons (if you have a concern for how any 
variables get used).

Hope that helps.

Ron





--- In equismetastock@xxxxxxxxxxxxxxx, "SHARAD LOHIA" 
<sharadlohia@xxx> wrote:
>
> i currently have something like this
> 
> L < Trough(1,L,5) and
> Trough(1,L,5) < Trough(2,L,5) AND
> REF(RSI(14),-TroughBARS(1,L,5)) > REF(RSI(14),-TroughBARS(2,L,5))
> 
> but obviously the ref function does not take a variable for time - 
so am stuck with that
> 
> this shud give me the last 2 bottoms in price - but getting teh RSI 
values at that time is the problem
> 
> SHARAD LOHIA
> 
>   ----- Original Message ----- 
>   From: pumrysh 
>   To: equismetastock@xxxxxxxxxxxxxxx 
>   Sent: Wednesday, May 28, 2008 9:54 PM
>   Subject: Re: [EquisMetaStock Group] Coding an exploration and 
expert advisor.
> 
> 
>   Sharad,
> 
>   Will help if you show us what you already have.
> 
>   Preston
> 
>   --- In equismetastock@xxxxxxxxxxxxxxx, "SHARAD LOHIA" 
>   <sharadlohia@> wrote:
>   >
>   > Can anybody pls help or guide
>   > 
>   > I want to program a Triple Divergence Indicator where price 
makes 3 
>   consecutive lower lows with intermediate rallies of 5% and the 
RSI 
>   Indicator has made higher bottoms on each successive lower low of 
>   price.
>   > 
>   > I have been able to program the price making 3 lower bottoms 
but am 
>   unable to program the RSI 3 higher bottoms. The problem i am 
facing 
>   is how to store the value of RSI when the first and second lower 
>   bottom was made - so as to be able to compare it with the current 
RSI 
>   value.
>   > 
>   > regards
>   > SHARAD LOHIA
>   > 
>   > ----- Original Message ----- 
>   > From: rbw1226 
>   > To: equismetastock@xxxxxxxxxxxxxxx 
>   > Sent: Tuesday, May 27, 2008 7:05 PM
>   > Subject: [EquisMetaStock Group] Coding an exploration and 
expert 
>   advisor.
>   > 
>   > 
>   > Coding an exploration and expert advisor.
>   > 
>   > I have tried to code an exploration containing these indicators:
>   > 
>   > Example of Alcoa Inc. - AA
>   > 16th 19th 20th 
>   > RSI 74.5878 77.8750 68.8206
>   > STOCH 82.2645 86.6776 80.1709
>   > MACD 1.62294 1.83796 1.88434
>   > SMI 85.2341 88.5809 84.9160
>   > 3Period MA(S)42.6300 43.4933 43.6567
>   > Close 43.15 44.59 43.23
>   > 
>   > Each are default but would like to know how to code if changing 
>   > default.
>   > What I am trying to do is based on values changing from uptrend 
>   to 
>   > signal/display values plus I reckon -1 or difference.(also if 
>   > changing from downtrend)
>   > For example each column would display like.
>   > RSI 68.8206 with a -1 or difference of value change being -
9.0544 
>   > from previous.
>   > STOCH 80.1709 -1 or -6.5067
>   > MACD 1.88434 +1 or +.04638
>   > SMI 84.9160 -1 or -3.6649
>   > 3Period MA(S) 43.6567 +1 or + .1634
>   > Close 43.23 -1 or -1.36
>   > 
>   > If this is not possible would it be possible to only display 
>   values 
>   > when a change from previous 2 periods trend occurs. Which only 
>   the 
>   > MACD and 3periodma would not display a value or signal in this 
>   case. 
>   > Or better yet would display value with also a 0 indicating no 
>   change 
>   > in trend. 
>   > 
>   > Thanks a lot in advance because I think I must be asking and 
>   trying 
>   > for something not possible. As for making this an expert 
advisor 
>   I 
>   > was thinking of when close crossed 3periodma and at least 2 
>   > indicators changed trend. 
>   > 
>   > Thanks again
>   > Burt
>   >
>



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/