Rank: Newbie
Groups: Registered, Registered Users Joined: 1/24/2012(UTC) Posts: 4
|
This is a continuation work from the Multi-time frame explorer as posted earlier. I'd found out that the result from previous explorer doesn't provided any added info. rather than outputing stock with the specified RSI value, the result doesn't not tell me if the RSI is trending , side-way or down on its trending slope. So the next step would be how would I write a formula that detect say a rising RSI. Would something like this works?
By referencing the value of RSI from previous periods..if the value is showing sign of higer highs..that would signify a rising RSI, right?
N1:= If(RSI(10) > Ref(RSI(10),-1),1,0);
N2:= If(Ref(RSI(10),-1) > Ref(RSI(10),-2),1,0);
N3:= If(Ref(RSI(10),-2) > Ref(RSI(10),-3),1,0);
N4:= If(Ref(RSI(10),-3) > Ref(RSI(10),-4),1,0);
N5:= If(Ref(RSI(10),-4) > Ref(RSI(10),-5),1,0);
Buy:= N1 AND N2 AND N3 AND N4 AND N5;;
Buy;
I am a newbie at this....so I'd appreciate any help I could get.
Thanks.
|
|
|
|
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)
|
Writing better code: 1. Use variables. It avoids having to recompute lots of things lots of times! 2. MS is Boolean in nature. If(something,1,0) is redundant code. 3. Read the MS User Manual and the free Equis Formula Primer. Read the Forum. Code:
myRSI:=RSI(10);
Buy:=Sum(myRSI > Ref(myRSI,-1), 5) = 5;
{plot}
Buy;
is much simple to edit and control, and faster for MS to interpret. wabbit [:D]
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 9/23/2009(UTC) Posts: 51
|
Before creating your Exploration, create an indicator using your code. Open a stock chart and plot your indicator and RSI. Compare the positioning of your BUY signals to that of the RSI indicator and your stock chart to see if the BUY signals are in the positions expected. This gives you eyes as to what is going on. Once the code looks right then create the Exploration.
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 1/24/2012(UTC) Posts: 4
|
Kudos to both wabbit and Alan R....that was a rather surprisingly quick response..
Cheers. :)
|
|
|
|
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.