NexusFi: Find Your Edge


Home Menu

 





Plot Time in MC Screener???


Discussion in MultiCharts

Updated
      Top Posters
    1. looks_one ChrisMoody with 4 posts (3 thanks)
    2. looks_two Jura with 2 posts (4 thanks)
    3. looks_3 SPMC with 2 posts (6 thanks)
    4. looks_4 MultiCharts with 1 posts (0 thanks)
    1. trending_up 3,012 views
    2. thumb_up 13 thanks given
    3. group 2 followers
    1. forum 7 posts
    2. attach_file 4 attachments




 
Search this Thread

Plot Time in MC Screener???

  #1 (permalink)
 
ChrisMoody's Avatar
 ChrisMoody 
Chapel Hill, NC
 
Experience: Advanced
Platform: Trade Navigator, MultiCharts, TOS
Broker: Stage 5, FXCM, IQ Feed
Trading: Futures, Forex, Options
Posts: 12 since Aug 2011
Thanks Given: 22
Thanks Received: 3

I'm new to MC....Going through my TradeStation Easy Language Home Study Course and there is one study for Radar Screen that I can't get to work with MC screener. It is supposed to show the time of day each symbol reaches it's High and Low price. The interval they used in the example is 5 minutes.

Example:

IBM - 5 Min - 09:35:00 AM (High) - 10:45:00 AM (Low)

The attached picture is showing the result I am getting. Any Help would be greatly appreciated.

Here is the Code I am using....

Var: DHigh(0), DLow(0), HighTime(0), LowTime(0);

If Date <> Date[1] then begin
DHigh = High;
DLow = Low;
HighTime = Time;
LowTime = Time;
end
else begin
If High > DHigh then
DHigh = High;
HighTime = Time;
end;
If Low < DLow then begin
DLow = Low;
LowTime = Time;
end;


Plot1 (HighTime, "HighTime");
Plot2 (LowTime, "LowTime");

It compiles but won't show the time. I've spent hours going thru there Help area and all reserved words that have to do with time.

Attached Thumbnails
Click image for larger version

Name:	ScreenerWindow.png
Views:	205
Size:	31.2 KB
ID:	51347  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
Quant vue
Trading Reviews and Vendors
 
  #2 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


ChrisMoody View Post
It compiles but won't show the time. I've spent hours going thru there Help area and all reserved words that have to do with time.

Well, actually it does show the time, since the EasyLanguage word Time returns the time in 1115.00 format (i.e. 11:15 in the morning). For example:

 
Code
Print("Time of bar: ", time);
returns...

Quoting 
Time of bar: 1406.00
Time of bar: 1411.00
Time of bar: 1416.00
Time of bar: 1421.00
Time of bar: 1426.00
Time of bar: 1431.00
Time of bar: 1436.00
Time of bar: 1441.00
Time of bar: 1446.00
Time of bar: 1451.00
Time of bar: 1456.00
Time of bar: 1501.00
Time of bar: 1506.00
Time of bar: 1511.00
Time of bar: 1516.00
Time of bar: 1521.00
Time of bar: 1526.00
Time of bar: 1531.00
Time of bar: 1536.00

So in your screenshot, you'll see the ES reaching the High at 1,515.0, meaning 15:15:00 (or a quarter pas three in the afternoon).

(Btw, if you use Time_s (instead of Time), you'll also get the seconds.)

-> It's not possible to plot a string value in the Market Scanner, so there is no way around this to show you the time in "clean" format.

In other parts of EasyLanguage, where you can use strings, you can use:
 
Code
Print("Time of bar: ", FormatTime("HH:mm:ss", el_timetodatetime_s(time_s)) );
which gives the following output..

Quoting 
Time of bar: 09:10:09
Time of bar: 09:13:22
Time of bar: 09:15:53
Time of bar: 09:16:55
Time of bar: 09:19:45
Time of bar: 09:23:23
Time of bar: 09:23:55
Time of bar: 09:25:50
Time of bar: 09:29:34
Time of bar: 09:41:57
Time of bar: 09:44:14
Time of bar: 09:47:15
Time of bar: 09:53:00
Time of bar: 09:59:10
Time of bar: 10:01:53
Time of bar: 10:05:01
Time of bar: 10:05:29
Time of bar: 10:11:35
Time of bar: 10:18:02
Time of bar: 10:30:27

Regards,
Jura

Reply With Quote
  #3 (permalink)
 
ChrisMoody's Avatar
 ChrisMoody 
Chapel Hill, NC
 
Experience: Advanced
Platform: Trade Navigator, MultiCharts, TOS
Broker: Stage 5, FXCM, IQ Feed
Trading: Futures, Forex, Options
Posts: 12 since Aug 2011
Thanks Given: 22
Thanks Received: 3


Jura,

Thanks so much for you help. Can I please get your input on one other issue. It seems to be showing the correct time for the low of the day, but not the high...

If you put the study below on a price chart it works perfectly by showing the Low and High of the day...but in the Screener using the code I used above it's not showing the correct time for the high...

If you take a look at symbol IWM for today the low was at 9:35 east coast and the high was at 3:50 or 15:50 but in the screener it is showing the high at 1805. The symbol is from the NYSE and I checked to make sure the sessions were correct and that it was set to East Coast time....any idea what is causing the High Time to be wrong????

Var: DHigh(0), DLow(0);

If Date <> Date[1] then begin
DHigh = High;
DLow = Low;
end
else begin
If High > DHigh then
DHigh = High;
If Low < DLow then
DLow = Low;
end;

If DLow <> 0 then begin
Plot1(DHigh, "DayHigh");
Plot2(DLow, "DayLow");
end;


Thanks Again for your input.....

Attached Thumbnails
Click image for larger version

Name:	Screener.png
Views:	188
Size:	30.8 KB
ID:	51647   Click image for larger version

Name:	IWMChart.png
Views:	184
Size:	41.1 KB
ID:	51648  
Started this thread Reply With Quote
  #4 (permalink)
 SPMC 
GER
 
Experience: Advanced
Platform: MC
Trading: ES
Posts: 144 since May 2011
Thanks Given: 11
Thanks Received: 213

This should work
 
Code
 
Var:  DHigh(0), DLow(0), HighTime(0), LowTime(0);

If Date <> Date[1] then begin
DHigh = 0;
DLow = 999999;
HighTime = Time;
LowTime = Time;
end; // End here

If High > DHigh then begin
DHigh = High;
HighTime = Time;
end;
If Low < DLow then begin
DLow = Low;
LowTime = Time;
end;


Plot1 (HighTime, "HighTime");
Plot2 (LowTime, "LowTime");

Reply With Quote
Thanked by:
  #5 (permalink)
 
ChrisMoody's Avatar
 ChrisMoody 
Chapel Hill, NC
 
Experience: Advanced
Platform: Trade Navigator, MultiCharts, TOS
Broker: Stage 5, FXCM, IQ Feed
Trading: Futures, Forex, Options
Posts: 12 since Aug 2011
Thanks Given: 22
Thanks Received: 3

Thanks that worked perfect....for some reason adding DHigh = 0; and DLow = 999999; changed the LowTime to a blue color plot that was hard to read with a black background....I added the 2 SetPlotColor's and everything is perfect....

PROBLEM SOLVED.....

Thanks Again....

 
Code
 

Var:  DHigh(0), DLow(0), HighTime(0), LowTime(0);

If Date <> Date[1] then begin
DHigh = 0;
DLow = 999999;
HighTime = Time;
LowTime = Time;
end; // End here

If High > DHigh then begin
DHigh = High;
HighTime = Time;
end;
If Low < DLow then begin
DLow = Low;
LowTime = Time;
end;


Plot1 (HighTime, "HighTime");
Plot2 (LowTime, "LowTime");

SetPlotColor (1, Green);
SetPlotColor (2, Red);

Started this thread Reply With Quote
Thanked by:
  #6 (permalink)
 SPMC 
GER
 
Experience: Advanced
Platform: MC
Trading: ES
Posts: 144 since May 2011
Thanks Given: 11
Thanks Received: 213

For better reading create a new string function ELTimeToString with

 
Code
inputs: TimeSelect( numericsimple );
var: s(""),strl(0);
s = NumToStr(TimeSelect,0);
strl = strlen(s);
if      strl = 4 then
    ELTimeToString =       LeftStr(s,2) + ":" + RightStr(s,2)
else if strl = 3 then
    ELTimeToString = "0" + LeftStr(s,1) + ":" + RightStr(s,2)
else if strl = 2 then
    ELTimeToString = "00:" + RightStr(s,2)
else if strl = 1 then
    ELTimeToString = "00:0" + RightStr(s,1)
else if strl = 0 then
    ELTimeToString = "00:00";
and then use
Plot1 ( ELTimetoString(HighTime), "HighTime");
Plot2 ( ELTimetoString(lowtime), "LowTime");

Reply With Quote
Thanked by:
  #7 (permalink)
 
ChrisMoody's Avatar
 ChrisMoody 
Chapel Hill, NC
 
Experience: Advanced
Platform: Trade Navigator, MultiCharts, TOS
Broker: Stage 5, FXCM, IQ Feed
Trading: Futures, Forex, Options
Posts: 12 since Aug 2011
Thanks Given: 22
Thanks Received: 3

SPMC....Thanks so much for going out of your way to help. It works perfect...

The attached photo shows where I started on the left study....and on the right is the study you helped me create....

Thanks Again....

Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2011-10-12 at 4.54.39 PM.png
Views:	188
Size:	34.2 KB
ID:	51757  
Started this thread Reply With Quote
Thanked by:
  #8 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


SPMC View Post
Plot1 ( ELTimetoString(HighTime), "HighTime");
Plot2 ( ELTimetoString(lowtime), "LowTime");

Also a big thanks from me SPMC, I didn't know you could plot strings with EasyLanguage. Thanks for proving me wrong.

Regards,
Jura

Reply With Quote




Last Updated on October 13, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts