me99

Newbie
3 0
hi
im attempting to code a very simple showme study in tradestation, all im trying to do is find the highest high within a range of data as that data progresses, so far i have:

{if the high is greater than 0 then the high becomes the new myhi, if on the next bar the high is > myhi then that high becomes the new myhi, and so on etc}

vars: myhi(0);

if high > myhi then myhi = high;

plot1 (myhi,"myhi");

however this gives me the highs of several bars, i just want the actaul highest bar-what am i doing wrong?
thanks

Moderator
8,655 981
Are you just trying to show the high of the day ? so that if a new high is reached it is highlighted ?

Paul

iq200

Well-known member
362 18
Hi me99,

Try

Variables: myhi(0);
myhi= Highest(High, Length);
plot1 (myhi,"myhi");

MyHigh will contain the highest High of the last Length bars.

Regards,

Imran

me99

Newbie
3 0
hi-thanks for the replies. essentially what im trying to do is get tradestation to paint a dot on the highest price that occurs within the first 40 mins of trading using 5 min charts, ive figured out the time component but i cant find a method of highlighting the highest price within that time. it always finds more than one relative high. the reason im trying to do this is that nearly 80% of the time the high or low of the morning for the ftse100 near month futures contract is made within the first 40 mins of trading-im trying to build a system around this.

Moderator
8,655 981
Why cant you do as ImranQ says and specify a time period length of 8 (ie 8 x 5 = 40) and with the time component being something like:

If Time >= 0800 and Time <= 0840 then begin;

This would limit the time scale to the first 40 minutes and with the length set to only 40 minutes you should only get 1 painted bar.

Also have you tried visiting

If that link doesnt work you will need to go to

and register from there

If you have registered then you will almost certainly find someone who has already written similar code to solve a problem like this.

Good Luck

Paul

fowkesp

Active member
129 0
me99,

This will do what you want, but there are countless ways of doing the same thing in EasyLanguage. that's what makes it such fun

Inputs: tim(0840), len(8);

If time=tim then begin
value1=highest(high,len);
plot1(value1,"myhi");
end;

This will look back 8 bars from 0840 and plot the highest high. If you change anything, remember that bar times in TradeStation are the end of the bar, not the beginning, ie the bar stamped 0805 covers the data from 0800 to 0805.

Paul

me99

Newbie
3 0
thanks to each of you for taking the time and effort to post the reply-its very much appreciated
i think i was going wrong in attempting to get tradestation to identify a relative high wihout the need to specify the length of bars to look back (so that i could apply the study to different charts of different bartypes (ie a 5 min chart, a 15 min chart etc, which will all have different lookback lengths for the first 40 mins of trading)i now realise life is a lot easier if i do as you suggest just count the length of bars to look back myself!,

once again-many thanks

fowkesp

Active member
129 0
me99,

All you need to do is create an indicator with a single input (in case you wanted to change it) - which would be the time after open to calculate the high (eg 40 mins). The start time for the session and number of bars to look back can be obtained or derived within EasyLanguage.

Paul

V
Replies
2
Views
953
Replies
4
Views
16K
Replies
1
Views
2K
Replies
0
Views
1K
Replies
4
Views
2K