Discussions
»
Special Interest Groups
»
Basic Coding Techniques
»
is it possible to code this formula without PREV?
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 3/23/2010(UTC) Posts: 3
|
formula is standard crossover formula:
If((C*.97)>PREV,C*.97,If((C*1.03)
|
|
|
|
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)
|
What's the rest of the code?
wabbit [:D]
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 3/23/2010(UTC) Posts: 3
|
interesting,5 times,i tried and i rewrite full formula,but it doesnt appear:(
i can't understand,i copy paste and only the half of this formula appear...it is in the system tester,it name "PS Percentage Crossover 3%"...
|
|
|
|
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)
|
Do you understand how the code works? When I see a plethora of PREV functions then I normally don't even bother wasting my time thinking how to write MSFL to remove these recursive functions, I usually just start writing an add-in function for myself. If you don't have the MDK and therefore cannot write your own function library, then you will have to analyse and reason what the code is trying to do, and then find a better way to achieve the aim. In this instance, although I think it might be possible to reconstruct the logic sans-PREV, I would probably have to think about it a bit more than I have, but I have seen a way to easily eliminate two of the PREV's: Code:
pct:=3;
aa:=C*(1-pct/100);
bb:=C*(1+pct/100);
x:=Min(Max(aa,PREV),bb);
{plot}
x;
Hope this helps. wabbit [:D]
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 3/23/2010(UTC) Posts: 3
|
thanks wabbit...only "one PREV" in a formula is better than "three PREV" in a formula...now i try to understand,how the code works and how do you write some add-in functions and eliminate unnecessary prev's..
i have mdk but,i can't write this formula,thank you...
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Special Interest Groups
»
Basic Coding Techniques
»
is it possible to code this formula without PREV?
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.