Rank: Member
Groups: Registered, Registered Users Joined: 2/10/2012(UTC) Posts: 11
|
HI all,
I'm having some problem trying to create a target depending on an event in the past. The amount of time to go in the past is variable, depending on the actual situation of the price.
I'll make an example to make it more clear:
Suppose to have a signal at 100. I want to check in the past till i find the first event X that happened above 105 (5% above the 100 of the todays signal), and take for example the close of that day.
I tried like this:
Code:
eventx:=H > ref(H,-1);
Todaysignal:= H+0.05;
ValueWhen(1, eventx AND H > Todaysignal*1.05,H);
The problem is that doing like this it evaluates both 'event x' and 'today signal' on the same day of the past. I'd like to consider the first 'event x' that happends above the current bar's 'today signal'*1.05.
Thanks to all who read this :)))
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/13/2005(UTC) Posts: 715 Location: Midwest, USA
Was thanked: 1 time(s) in 1 post(s)
|
Not clear just what you want -- be more specific, or better yet, draw on the screen, take a screen shot, save to disk and put in your msg with IMGUR.
|
|
|
|
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)
|
If my understanding the problem is correct, then you cannot achieve the results in MS as you need a loop function which is not available in MSFL, only higher level languages which could be used to create an extfml().
wabbit [:D]
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 2/10/2012(UTC) Posts: 11
|
I try to explain the problem better:
let's suppose today is the 31 of december, and the High of AAA is $100.
I need to take the high of the first bar when (for example) a bullish engulfing happends above the high of today (so the $100 of the 31 of december) * 1.05 =$105.
I tried but using the valuewhen it messes up, because going backward to find the bullish engulfing, it also consider the high the day where it is and no more the high of the 31 of december. I want the price limit of 105 to be based on the present, but the high of the bullish engulfing be taken from a day in the past that does not depend on a fixed amount of time.
anyway i think wabbit annswered me :(
what would you do if you had to do something like this? which language would you use?
ty :)
|
|
|
|
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)
|
The simplest solution is to use a higher level language like C/C++ with the MDK to create an external function library.
Other solutions involve using other charting/trading applications with more powerful programming than MS scripts.
wabbit [:D]
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 2/10/2012(UTC) Posts: 11
|
OK wabbit, thx for the tip ^^
|
|
|
|
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.