Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 7/20/2010(UTC) Posts: 24
|
Dear Wabbit, It is better to go point by point, making it simple and start from point one. So suppose we are "during #5 period" and we want to have "Highest High of Closing price from 2 long-sessions ago" (means session #1). Thank you and Best Regards
DimC
|
|
|
|
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)
|
OK... until you post some of your own genuine attempts to code this solution (with a properly defined problem) this will be my last input to this: To plot the highest CLOSE price of a period two long sessions ago (regardless of what long session you are in now) or to plot the lowest CLOSE price of a period two short sessions ago (regardless of what short session you are in now) use something like: Code:
sessionsLookBack:=2;
ma1:=Mov(C,3,E);
ma2:=Mov(C,5,E);
longStart:=Cross(ma1,ma2);
longEnd:=Cross(ma2,ma1);
shortStart:=longEnd;
shortEnd:=longStart;
If(BarsSince(longStart)<BarsSince(shortStart),
ValueWhen(sessionsLookBack,longEnd,Ref(HighestSince(1,longStart,C),-1)),
ValueWhen(sessionsLookBack,shortEnd,Ref(LowestSince(1,shortStart,C),-1))
);
This code should provide enough of an example for you to figure out how to make your own definitions for future refinements. If you get stuck, post your best attempt at the code along with a proper definition of what the code is supposed to do and a full description/example of how the code is failing to meet the expectation and I am sure someone will donate some of their time to ASSIST you to correct the error. wabbit [:D]
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 7/20/2010(UTC) Posts: 24
|
Dear Wabbit, Thank you very very much for the entire support and help. Now it shows exactly requested definition. My problem, was that i could not "arrive" to this expression, which was my very first question : ValueWhen(sessionsLookBack,longEnd,Ref(HighestSince(1,longStart,C),-1))
Following your indications, i will come back as soon as possible. Thank you again and i hope that also other friends can use this approach.
Best Regards DimC
|
|
|
|
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.