Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Updated April 29, 2010
trending_up
6,573 views
thumb_up
5 thanks given
group
1 followers
forum
8 posts
attach_file
3 attachments
April 20th, 2010, 10:23 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,672 since Jun 2009
Thanks Given: 33,404
Thanks Received: 102,210
Hey guys, I felt like there may be a need for a chart markup indicator for EasyLanguage .
So, here is what I came up with so far tonight. It will mark the Open, High, Low, Close, and the gap . It works best on a RTH chart (vs a Globex chart).
Each trendline color is configurable.
Let me know what you think, and feel free to make enhancements and share them back
[img]https://nexusfi.com/v/v57xvz.png[/img]
[img]https://nexusfi.com/v/ktgxee.png[/img]
[img]https://nexusfi.com/v/8pc4kj.png[/img]
One known problem is the lines/text are drawn per the GetAppInfo(aiLowestDispValue) meaning they will align themselves to the bottom of your chart just above the time axis. This works great in "real-time" if you load the indicator or reload it, but as you scroll back or forward, these past plots do not re-calculate or re-align themselves. I am not sure how to fix this, I am open to suggestions! It means that you may need to reload the indicator/refresh it to see the plots on historical data.
Another known limitation is it works only on 1 minute or 5 minute charts (well, I guess 30 minute could work too actually). This is due to the time recognition I coded for the open/close times. There has got to be a better way to do this, let me know!
Here is the EasyLanguage code:
Code
// Big Mike Trading https://nexusfi.com
// 20 April 2010
// Indicator
// Specify open and close time in exact format per example, works only on 1 minute or 5 minute charts
input :
open_time ( "8:30:00 AM" ),
close_time ( "1:30:00 PM" ),
lineoffset ( 0.50 ),
textoffset ( 0.10 );
vars :
tlid_gap ( 0 ),
tlid2_gap ( 0 ),
txid_gap ( 0 ),
tlid_open ( 0 ),
txid_open ( 0 ),
tlid_close ( 0 ),
txid_close ( 0 ),
lastclose ( 0 ),
lastcloset ( 0 ),
lastclosed ( 0 ),
dhigh ( 0 ),
dlow ( 0 ),
tlid_high ( 0 ),
tlid_low ( 0 ),
tlid_high_d ( 0 ),
tlid_high_t ( 0 ),
tlid_low_d ( 0 ),
tlid_low_t ( 0 ),
txid_high ( 0 ),
txid_low ( 0 );
once Plot1 ( 0 , "Open" );
once Plot2 ( 0 , "Close" );
once Plot3 ( 0 , "Gap Up" );
once Plot4 ( 0 , "Gap Down" );
once Plot5 ( 0 , "High" );
once Plot6 ( 0 , "Low" );
if date <> date [ 1 ] then begin
dhigh = H ;
dlow = L ;
tlid_high_d = D ;
tlid_high_t = T ;
tlid_low_d = D ;
tlid_low_t = T ;
tlid_high = TL_New ( date , time , H , date , time , H );
tlid_low = TL_New ( date , time , L , date , time , L );
txid_high = Text_New ( date , time , dhigh , text ( "H: " , dhigh ));
txid_low = Text_New ( date , time , dlow , text ( "L: " , dlow ));
end ;
if H > dhigh then begin dhigh = H ; tlid_high_d = D ; tlid_high_t = T ; end ;
if H < dhigh then begin
TL_SetBegin ( tlid_high , tlid_high_d , tlid_high_t , dhigh );
TL_SetEnd ( tlid_high , date , time , dhigh );
TL_SetColor ( tlid_high , GetPlotColor ( 5 ));
Text_SetLocation ( txid_high , date , time , dhigh );
Text_SetStyle ( txid_high , 1 , 1 );
Text_SetString ( txid_high , text ( "H: " , dhigh , " " ));
Text_SetColor ( txid_high , GetPlotColor ( 5 ));
end ;
if L < dlow then begin dlow = L ; tlid_low_d = D ; tlid_low_t = T ; end ;
if L > dlow then begin
TL_SetBegin ( tlid_low , tlid_low_d , tlid_low_t , dlow );
TL_SetEnd ( tlid_low , date , time , dlow );
TL_SetColor ( tlid_low , GetPlotColor ( 6 ));
Text_SetLocation ( txid_low , date , time , dlow );
Text_SetStyle ( txid_low , 1 , 0 );
Text_SetString ( txid_low , text ( "L: " , dlow , " " ));
Text_SetColor ( txid_low , GetPlotColor ( 6 ));
end ;
if TimeToString ( ELTimeToDateTime ( time )) = open_time then begin
tlid_gap = TL_New ( date , time , lastclose , date , time , iff ( O > lastclose , L - lineoffset , H + lineoffset ));
tlid2_gap = TL_New ( lastclosed , lastcloset , lastclose , date , time , lastclose );
if O > lastclose then txid_gap = Text_New ( date , time , lastclose - textoffset , text ( "Gap +" , (( O - lastclose ) / MinMove * PriceScale ): 0 : 0 ));
if O < lastclose then txid_gap = Text_New ( date , time , lastclose + textoffset , text ( "Gap -" , (( lastclose - O ) / MinMove * PriceScale ): 0 : 0 ));
Text_SetStyle ( txid_gap , 1 , 2 );
TL_SetColor ( tlid_gap , iff ( O > lastclose , GetPlotColor ( 3 ), GetPlotColor ( 4 )));
TL_SetColor ( tlid2_gap , iff ( O > lastclose , GetPlotColor ( 3 ), GetPlotColor ( 4 )));
Text_SetColor ( txid_gap , iff ( O > lastclose , GetPlotColor ( 3 ), GetPlotColor ( 4 )));
tlid_open = TL_New ( date , time , GetAppInfo ( aiLowestDispValue ) + ( textoffset * 2 ), date , time , MinList ( lastclose - lineoffset , O - lineoffset ));
txid_open = Text_New ( date , time , GetAppInfo ( aiLowestDispValue ) + textoffset , text ( "O: " , O ));
TL_SetColor ( tlid_open , GetPlotColor ( 1 ));
Text_SetColor ( txid_open , GetPlotColor ( 1 ));
Text_SetStyle ( txid_open , 0 , 2 );
end ;
if TimeToString ( ELTimeToDateTime ( time )) = close_time then begin
tlid_close = TL_New ( date , time , GetAppInfo ( aiLowestDispValue ) + ( textoffset * 2 ), date , time , C - lineoffset );
txid_close = Text_New ( date , time , GetAppInfo ( aiLowestDispValue ) + textoffset , text ( "C: " , C , " " ));
TL_SetColor ( tlid_close , GetPlotColor ( 2 ));
Text_SetColor ( txid_close , GetPlotColor ( 2 ));
Text_SetStyle ( txid_close , 1 , 2 );
lastclose = C ;
lastclosed = D ;
lastcloset = T ;
end ;
I've also attached the MultiCharts .pla.
Mike
Attached Files
Elite Membership required to download: BMT-Chart Markup.pla
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
April 23rd, 2010, 02:30 PM
Canada
Experience: Advanced
Platform: NT, TS
Broker: Amp
Trading: ES
Posts: 57 since Sep 2009
Thanks Given: 1
Thanks Received: 69
Mike - thank you so much for putting this indicator together, I'm having a problem with the Gap when using on the ES .... it doesn't show the correct number and I'm not familiar with your contruction:
if O > lastclose then txid_gap = Text_New(date, time, lastclose - textoffset, text("Gap +", ((O-lastclose) / MinMove*PriceScale):0:0));
if O < lastclose then txid_gap = Text_New(date, time, lastclose + textoffset, text("Gap -", ((lastclose-O) / MinMove*PriceScale):0:0));
Can you please point me in the right direction? Thanks in advance.
April 23rd, 2010, 04:56 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,672 since Jun 2009
Thanks Given: 33,404
Thanks Received: 102,210
sharp2be
Mike - thank you so much for putting this indicator together, I'm having a problem with the
Gap when using on the ES .... it doesn't show the correct number and I'm not familiar with your contruction:
if O > lastclose then txid_gap = Text_New(date, time, lastclose - textoffset, text("Gap +", ((O-lastclose) / MinMove*PriceScale):0:0));
if O < lastclose then txid_gap = Text_New(date, time, lastclose + textoffset, text("Gap -", ((lastclose-O) / MinMove*PriceScale):0:0));
Can you please point me in the right direction? Thanks in advance.
Are you using a RTH chart or a 24h chart? I think the error might be in the Open price, which is used for the gap.
On the menu, did you enter the open and close time precisely in the format of "H:MM:SS AM" ? So for 9:30am on ES you need 9:30:00 AM. You might try changing it to 9:35:00 AM and see if that does it, since your first candle might be the Open candle, otherwise it would need code changes.
Mike
April 23rd, 2010, 05:07 PM
Canada
Experience: Advanced
Platform: NT, TS
Broker: Amp
Trading: ES
Posts: 57 since Sep 2009
Thanks Given: 1
Thanks Received: 69
Mike - please see attached ... it shows the Close, Open and also the Gap but the gap amount is incorrect (should not be 24).. looking at the code it seems the calculation is correct, just the display is incorrect..
April 23rd, 2010, 05:36 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,672 since Jun 2009
Thanks Given: 33,404
Thanks Received: 102,210
sharp2be
Mike - please see attached ... it shows the Close, Open and also the
Gap but the gap amount is incorrect (should not be 24).. looking at the code it seems the calculation is correct, just the display is incorrect..
Gotcha, I see. It has to do with the Tick Size (MinMove/PriceScale) most likely. I only tested it on CL, and ES is different.
I'll take a look at it as soon as I can.
Mike
April 23rd, 2010, 05:39 PM
Canada
Experience: Advanced
Platform: NT, TS
Broker: Amp
Trading: ES
Posts: 57 since Sep 2009
Thanks Given: 1
Thanks Received: 69
Thanks Mike
April 26th, 2010, 06:25 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,672 since Jun 2009
Thanks Given: 33,404
Thanks Received: 102,210
I tested this on my side today for the ES, it seemed to work fine (no code changes).
I am central time.
I set the "open" to "8:35:00 AM", because the time stamp of the bar is the closing time of the bar in MultiCharts . I set the "close" to "1:30:00 PM".
I believe it worked correctly. The gap is listed as +3, as in 3 ticks. The open is @ 1213.50 and the close 1207.50. The high is 1216.50 and low 1207.50. The close-to-close was -21 ticks from yesterday.
Shown here:
[img]https://nexusfi.com/v/b8j9g9.png[/img]
I had incorrectly been using 8:30:00 AM it should be 8:35:00 AM, please take note (For ES, central time). For CL it would be 8:05:00 AM (central time).
Mike
April 29th, 2010, 08:10 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,672 since Jun 2009
Thanks Given: 33,404
Thanks Received: 102,210
Hi guys,
A new version is here, this should now work on any chart (not just 1 or 5 minute), and it also fixes a couple small problems.
Code
// Big Mike Trading https://nexusfi.com // 20 April 2010 // Indicator // Specify open and close time in exact format per example H:MM:SS AM/PM input : open_time ( "8:05:00 AM" ), close_time ( "1:30:00 PM" ), lineoffset ( 0.50 ), textoffset ( 0.10 ); vars : tlid_gap ( 0 ), tlid2_gap ( 0 ), txid_gap ( 0 ), tlid_open ( 0 ), txid_open ( 0 ), tlid_close ( 0 ), txid_close ( 0 ), lastclose ( 0 ), lastcloset ( 0 ), lastclosed ( 0 ), dhigh ( 0 ), dlow ( 0 ), tlid_high ( 0 ), tlid_low ( 0 ), tlid_high_d ( 0 ), tlid_high_t ( 0 ), tlid_low_d ( 0 ), tlid_low_t ( 0 ), txid_high ( 0 ), txid_low ( 0 ), openset ( false ), closeset ( false ), close_prefix ( "+" ); once Plot1 ( 0 , "Open" ); once Plot2 ( 0 , "Close" ); once Plot3 ( 0 , "Gap Up" ); once Plot4 ( 0 , "Gap Down" ); once Plot5 ( 0 , "High" ); once Plot6 ( 0 , "Low" ); if date <> date [ 1 ] then begin openset = false ; closeset = false ; dhigh = H ; dlow = L ; tlid_high_d = D ; tlid_high_t = T ; tlid_low_d = D ; tlid_low_t = T ; tlid_high = TL_New ( date , time , H , date , time , H ); tlid_low = TL_New ( date , time , L , date , time , L ); txid_high = Text_New ( date , time , dhigh , text ( "H: " , dhigh )); txid_low = Text_New ( date , time , dlow , text ( "L: " , dlow )); end ; if H > dhigh then begin dhigh = H ; tlid_high_d = D ; tlid_high_t = T ; end ; if H <= dhigh then begin TL_SetBegin ( tlid_high , tlid_high_d , tlid_high_t , dhigh ); TL_SetEnd ( tlid_high , date , time , dhigh ); TL_SetColor ( tlid_high , GetPlotColor ( 5 )); Text_SetLocation ( txid_high , date , time , dhigh ); Text_SetStyle ( txid_high , 1 , 1 ); Text_SetString ( txid_high , text ( "H: " , dhigh , " " )); Text_SetColor ( txid_high , GetPlotColor ( 5 )); end ; if L < dlow then begin dlow = L ; tlid_low_d = D ; tlid_low_t = T ; end ; if L >= dlow then begin TL_SetBegin ( tlid_low , tlid_low_d , tlid_low_t , dlow ); TL_SetEnd ( tlid_low , date , time , dlow ); TL_SetColor ( tlid_low , GetPlotColor ( 6 )); Text_SetLocation ( txid_low , date , time , dlow ); Text_SetStyle ( txid_low , 1 , 0 ); Text_SetString ( txid_low , text ( "L: " , dlow , " " )); Text_SetColor ( txid_low , GetPlotColor ( 6 )); end ; //if TimeToString(ELTimeToDateTime(time)) = open_time then begin if time >= StringToTime ( open_time ) and openset = false then begin openset = true ; tlid_gap = TL_New ( date , time , lastclose , date , time , iff ( O > lastclose , L - lineoffset , H + lineoffset )); tlid2_gap = TL_New ( lastclosed , lastcloset , lastclose , date , time , lastclose ); if O > lastclose then txid_gap = Text_New ( date , time , lastclose - textoffset , text ( "Gap +" , (( O - lastclose ) / MinMove * PriceScale ): 0 : 0 )); if O < lastclose then txid_gap = Text_New ( date , time , lastclose + textoffset , text ( "Gap -" , (( lastclose - O ) / MinMove * PriceScale ): 0 : 0 )); Text_SetStyle ( txid_gap , 1 , 2 ); TL_SetColor ( tlid_gap , iff ( O > lastclose , GetPlotColor ( 3 ), GetPlotColor ( 4 ))); TL_SetColor ( tlid2_gap , iff ( O > lastclose , GetPlotColor ( 3 ), GetPlotColor ( 4 ))); Text_SetColor ( txid_gap , iff ( O > lastclose , GetPlotColor ( 3 ), GetPlotColor ( 4 ))); tlid_open = TL_New ( date , time , GetAppInfo ( aiLowestDispValue ) + ( textoffset * 2 ), date , time , MinList ( lastclose - lineoffset , O - lineoffset )); txid_open = Text_New ( date , time , GetAppInfo ( aiLowestDispValue ) + textoffset , text ( "O: " , O )); TL_SetColor ( tlid_open , GetPlotColor ( 1 )); Text_SetColor ( txid_open , GetPlotColor ( 1 )); Text_SetStyle ( txid_open , 0 , 2 ); end ; //if TimeToString(ELTimeToDateTime(time)) = close_time then begin if ( time >= StringToTime ( close_time ) and closeset = false ) or Sess1EndTime = time then begin closeset = true ; tlid_close = TL_New ( date , time , GetAppInfo ( aiLowestDispValue ) + ( textoffset * 2 ), date , time , C - lineoffset ); if C - lastclose > 0 then close_prefix = "+" else close_prefix = "" ; txid_close = Text_New ( date , time , GetAppInfo ( aiLowestDispValue ) + textoffset , text ( "C: " , C , " (" , close_prefix , (( C - lastclose ) / MinMove * PriceScale ): 0 : 0 , " ticks) " )); TL_SetColor ( tlid_close , GetPlotColor ( 2 )); Text_SetColor ( txid_close , GetPlotColor ( 2 )); Text_SetStyle ( txid_close , 1 , 2 ); lastclose = C ; lastclosed = D ; lastcloset = T ; end ;
MultiCharts .pla attached.
Mike
Attached Files
Elite Membership required to download: BMT ChartMarkup.pla
Last Updated on April 29, 2010