Minutes to seconds - EasyLanguage Programming | futures io social day trading
futures io futures trading


Minutes to seconds
Updated: Views / Replies:253 / 2
Created: by Pitrader Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Minutes to seconds

  #1 (permalink)
Canada
 
 
Posts: 10 since Feb 2011
Thanks: 2 given, 0 received

Minutes to seconds

I am hoping that someone can help me. I have some code below that places horizontal lines on the chart at a specific time with specific lengths. The indicator was originally written for me back in the day when a 1 minute chart was the smallest time compression available. Would it be possible to have this indicator adaptable so it will function on second charts? Any help would be greatly appreciated.

 
Code
// ==========================================
// 


inputs:
	DateOfLine(1180517),
	DistFromSwing_Ticks(3),
	StartBarCount_Time(700),
	ExtendLines_Right(false),
	
	Line1_Color(darkred),
	Line1_StartBarCount(-2),
	Line1_EndBarCount(8),
		
	Line2_Display(true),
	Line2_StartBarCount(8),
	Line2_EndBarCount(18),
		
	Line3_Display(true),
	Line3_StartBarCount(16),
	Line3_EndBarCount(28);
		
	 
vars: 
	X(0),
	startHiTLValue(0),
	startLoTLValue(0),
	ii(0),
	looCounter(0),
	ColorCount(0),
	PriDisplayValue(0),
	EndCount(0),
	loTLPrice(0),
	hiTLPrice(0),
	TickValue(minmove/pricescale);

arrays:
	LineSwitch[3](false),
	TLID_Main[3](-1),
	StartBarCount[3](0),
	EndBarCount[3](0),
	LineHigh[3](0),
	LineLow[3](999999);

once begin
	LineSwitch[1] = true;
	StartBarCount[1] = calctime(StartBarCount_Time, Line1_StartBarCount * barinterval);
	EndBarCount[1] = calctime(StartBarCount_Time, Line1_EndBarCount * barinterval);
	
	LineSwitch[2] = Line2_Display;
	StartBarCount[2] = calctime(StartBarCount_Time, Line2_StartBarCount * barinterval);
	EndBarCount[2] = calctime(StartBarCount_Time, Line2_EndBarCount * barinterval);
	
	LineSwitch[3] = Line3_Display;
	StartBarCount[3] = calctime(StartBarCount_Time, Line3_StartBarCount * barinterval);
	EndBarCount[3] = calctime(StartBarCount_Time, Line3_EndBarCount * barinterval);
	
	 	
	
	if Line1_Color = Darkred then ColorCount = 1 else ColorCount = 0;
	
	for X = 1 to 3 begin
		if LineSwitch[X] then
		begin 
			if ColorCount > 1 then ColorCount = 0;
			PriDisplayValue = pz_iff(ColorCount = 0, getappinfo(aiLowestDispValue), getappinfo(aiHighestDispValue));
			
			if ColorCount = 0 then
				startLoTLValue = getappinfo(aiLowestDispValue) 
			else
				startHiTLValue = getappinfo(aiHighestDispValue) ;
			
			TLID_Main[X] = tl_new(currentdate, StartBarCount[X], PriDisplayValue, currentdate, EndBarCount[X], PriDisplayValue);
			tl_setcolor(TLID_Main[X], pz_iff(ColorCount = 0, Darkblue, Darkred));
			tl_setstyle(TLID_Main[X],(2));
			TL_SetSize (TLID_Main[X],(3)); 
			tl_setextright(TLID_Main[X], ExtendLines_Right);
			
			ColorCount += 1; 
		end ;
	end;
end;

if d = DateOfLine then begin
	{for X = 1 to 11 begin
		if t >= StartBarCount[X - 1] then EndCount = X + 1;
	end;}
	for X = 1 to 3 begin
		if LineSwitch[X] then
		begin 
			if t >= StartBarCount[X] and t <= EndBarCount[X] then begin
				if h > LineHigh[X] then LineHigh[X] = h;
				if l < LineLow[X] then LineLow[X] = l;
			end ;
			
			if t < StartBarCount[X] then
			begin		
				loTLPrice = startLoTLValue ;
				hiTLPrice = startHiTLValue ;
									
				if X > 2 then 
				begin 
					ii = X - 2 ;
					looCounter = 0 ;
					
					while ii > 0 
					begin
						if LineSwitch[ii] and t >= StartBarCount[ii] then
						begin 
							loTLPrice = LineLow[ii] ;
							hiTLPrice = LineHigh[ii] ;	
						end ;
										
						ii -= 2 ;
						
						looCounter += 1 ;
						if looCounter > 10 then
							break ;
					end ; 
				
				end ;		
			end
			else
			begin 
				loTLPrice = LineLow[X] ;
				hiTLPrice = LineHigh[X] ;
			end ;
			


			if tl_getcolor(TLID_Main[X]) = Darkblue then begin
				tl_setend(TLID_Main[X], d, EndBarCount[X], loTLPrice - DistFromSwing_Ticks * TickValue);
				tl_setbegin(TLID_Main[X], d, StartBarCount[X], loTLPrice - DistFromSwing_Ticks * TickValue);
			end
			else begin
				tl_setend(TLID_Main[X], d, EndBarCount[X], hiTLPrice + DistFromSwing_Ticks * TickValue);
				tl_setbegin(TLID_Main[X], d, StartBarCount[X], hiTLPrice + DistFromSwing_Ticks * TickValue);
			end;

		end ;
	end;
end;

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,084 since Apr 2013
Thanks: 375 given, 1,338 received


Pittrader,

you will have to exchange the legacy trendlines with object oriented EasyLanguage trendline objects to be able to place trendlines either bar number or datetime based.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:

Reply



futures io > > > > > Minutes to seconds

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Show us your trading desks and win over $5,000 in prizes w/Jigsaw Trading

September
 

Webinar: The Best Entries and Exits in trading & in life w/Agustin Lebron

Elite only
 

Webinar: NinjaTrader 8 Newest Features Release Sneak Peek

Sep 26
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code for hour minutes and seconds victorin NinjaTrader 8 July 28th, 2016 06:37 AM
Posts reloading with #0 every few seconds gregid Tech Support 1 March 31st, 2015 09:40 AM
RangeBarTime indicator does not return seconds, only minutes. Suggestions? MBAGearhead Open E Cry 0 January 27th, 2015 03:42 PM
Best optimization period for 15 minutes and 5 minutes blessedone Elite Automated Trading 1 November 22nd, 2014 10:43 AM
Time Seconds with Easylanguage azbarroso Traders Hideout 4 October 25th, 2010 09:52 PM


All times are GMT -4. The time now is 01:53 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts