Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 03-23-2009, 10:17 AM   #1

Join Date: Oct 2006
Location: na
Posts: 307
Ignore this user

Thanks: 33
Thanked 89 Times in 58 Posts

Previous Day OHLC in OEC Via Easylanguage

Since everyone was so helpful the last time, I have one other question. I am trying to plot the Open, High, Low, Close of the previous day via the following code from MC:
Code:
variables:
	Counter( 0 ),
	YestOpen( 0 ),
	TodaysOpen( 0 ),
	YestHigh( 0 ),
	TodaysHigh( 0 ),
	YestLow( 0 ),
	TodaysLow( 0 ),
	YestClose( 0 ),
	TodaysClose( 0 ) ;
	
if Date <> Date[1] then
	begin
	{ increment Counter to be sure enough data is processed - see comment below }
	Counter = Counter + 1 ;
	YestOpen = TodaysOpen ;
	YestHigh = TodaysHigh ;
	YestLow = TodaysLow ;
	YestClose = Close[1] ;
	TodaysOpen = Open ;
	TodaysHigh = High ;
   	TodaysLow = Low ;
	end
else
	begin
	if High > TodaysHigh then
		TodaysHigh = High ;
	if Low < TodaysLow then
		TodaysLow = Low ;
	end ;

if Counter >= 2 and BarType < 3 then { if at least one full day's data has been
 processed and chart bar interval is daily, intra-day, or tick bar, then plot }
	begin
	Plot1( YestOpen, "YestOpen" ) ;
	Plot2( YestHigh, "YestHigh" ) ;
	Plot3( YestLow, "YestLow" ) ;
	Plot4( YestClose, "YestClose" ) ;
	end ;
However, in OEC (not sure if other data vendors are like this) products that trade on sunday (eg Bonds and Notes) the sunday trading is treated like an entire day. I want to use the information from friday, not sunday. I came across a pivot indicator that ignored the weekends, but when i tried to mesh that code with what I was using, I couldnt get it to compile. Once again, thanks for any help.
trader273 is offline  
Reply With Quote
Old 03-23-2009, 10:53 AM   #2

Join Date: Jan 2008
Location: San Francisco
Posts: 394
Ignore this user

Thanks: 17
Thanked 338 Times in 156 Posts

Re: Previous Day OHLC in OEC Via Easylanguage

there are simple reserved words for this:

highd(0) = todays high
highd(1) = yesterdays high
highd(2) = high of 2 days ago

opend(0) = todays open
opend(1) = yesterdays open


etc.....
Frank is offline  
Reply With Quote
Old 03-23-2009, 10:53 AM   #3

Harlequin's Avatar

Join Date: Apr 2008
Location: London
Posts: 77
Ignore this user

Thanks: 23
Thanked 15 Times in 11 Posts

Re: Previous Day OHLC in OEC Via Easylanguage

Does OEC support the ELCollections.dll

This is how I do it in Multicharts. You have a daily chart or scanner window with one indicator to save the values from the previous trading day and then another indicator reads the values on your intraday chart.
Harlequin is offline  
Reply With Quote
Old 03-23-2009, 11:10 AM   #4

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Previous Day OHLC in OEC Via Easylanguage

Quote:
Originally Posted by Frank »
there are simple reserved words for this:
highd(0) = todays high
highd(1) = yesterdays high
highd(2) = high of 2 days ago
opend(0) = todays open
opend(1) = yesterdays open
etc.....
these are functions, not reserved words.

ie. someone wrote a script/"program" that perform those operations.
Tams is offline  
Reply With Quote
Old 03-23-2009, 11:50 AM   #5

Join Date: Jan 2008
Location: San Francisco
Posts: 394
Ignore this user

Thanks: 17
Thanked 338 Times in 156 Posts

Re: Previous Day OHLC in OEC Via Easylanguage

I admit I do not know enough about programming to know what exactly they are --- but I use Open Ecry and calling functions in the code editor on the OEC platform requires an extra step vs the seamless way EasyLanguage does it. On the OEC platform -- to the coder anyway -- there is no extra step needed so there is no effective difference between whatever they are labeled vs the label 'reserved words'. Just trying to help the original poster, not trying to argue semantics.
Frank is offline  
Reply With Quote
Old 03-23-2009, 12:26 PM   #6

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Previous Day OHLC in OEC Via Easylanguage

I did not mean to be picky. Please do not take it as a challenge. I merely wanted to clarify.


A reserved word (also called keyword) is a "command/operation" that is built-in to the program.

eg. High, print, array, text, etc.


A function is a little "program", written with the reserved words, to perform certain operation.

eg. MACD, stochastic, RSI, average, etc.



A function might, or might not be residing in your program.
If you haven't got it in your computer, you can get the code and install it.

However a reserved word is built-in to your program.
If your program haven't got that keyword, then that means your program does not support that keyword. There is no way to get that into your computer.

e.g. some of the keywords in MultiCharts are not available in tradestation or OEC.
Tams is offline  
Reply With Quote
Old 03-23-2009, 12:30 PM   #7

Join Date: Jan 2008
Location: San Francisco
Posts: 394
Ignore this user

Thanks: 17
Thanked 338 Times in 156 Posts

Re: Previous Day OHLC in OEC Via Easylanguage

Tams,

I am just curious -- is there a way to tell if its a keyword or a function? I mean, you do you know opend(0) is not just a keyword in the world of Open Ecry? thx in advance.
Frank is offline  
Reply With Quote
Old 03-23-2009, 12:33 PM   #8

Join Date: Jan 2008
Location: San Francisco
Posts: 394
Ignore this user

Thanks: 17
Thanked 338 Times in 156 Posts

Re: Previous Day OHLC in OEC Via Easylanguage

I am interested because I noted this in another thread (note that I am a programming ignoramus so I just have to figure things out without really knowing what is going on under the hood)

http://www.traderslaboratory.com/for...n-ts-5513.html
Frank is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Value Area And Previous Days Range] Soultrader Trading Videos 11 09-05-2011 06:34 AM
Indicator As OHLC or Candlesticks in Investor/RT forsearch Linnsoft 7 07-16-2008 08:33 AM
OHLC Marker for NT pajusa Technical Analysis 0 03-27-2008 08:21 PM
Using Previous Day POC as Target Dogpile Market Profile 11 06-01-2007 04:42 PM
[Candle Patterns and Previous Day High] Soultrader Trading Videos 7 03-20-2007 02:20 AM

All times are GMT -4. The time now is 09:42 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.