How to determine the time of the current variable and the previous one. - EasyLanguage Programming | futures io social day trading
futures io futures trading


How to determine the time of the current variable and the previous one.
Updated: Views / Replies:113 / 7
Created: by Fobos 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
 

How to determine the time of the current variable and the previous one.

  #1 (permalink)
Ukraina
 
 
Posts: 15 since Aug 2010
Thanks: 5 given, 0 received

How to determine the time of the current variable and the previous one.

Hello! Tell me how to determine the time of the current variable and the previous one. The indicator shows a bar that satisfies the conditions, you need to find the time value of the last bar that satisfies the indicator conditions and the time value of the previous bar that satisfies the indicator conditions.

 
Code
Inputs:
vTL(3), 
BuyTLColor (blue),
SellTLColor (red),
NetTLColor (white),
TLSize (1),
TLStyle (1);


Variables:
var0(0),
vTLValue(0),
BuyTL (1),
NetTL (1),
SellTL (1);


begin

var0 = Volume ;
var0 = Ticks ;

vTLValue = TL_GetEndVal(vTL);
If (close[0] > close[1] and var0 > vTLValue) then
BuyTL = TL_New_s(Date,Time_s, Low, Date, Time_s, High); 
TL_SetColor(BuyTL, BuyTLColor); 
TL_SetSize(BuyTL,TLSize); 
TL_SetStyle(BuyTL, TLStyle);

If (close[0] < close[1]and var0 > vTLValue) then
SellTL = TL_New_s(Date,Time_s, Low, Date, Time_s, High); 
TL_SetColor(SellTL, SellTLColor); 
TL_SetSize(SellTL,TLSize); 
TL_SetStyle(SellTL, SellTLColor);

If (close[0] = close[1]and var0 > vTLValue) then
NetTL = TL_New_s(Date,Time_s, Low, Date, Time_s, High); 
TL_SetColor(NetTL, NetTLColor); 
TL_SetSize(NetTL,TLSize); 
TL_SetStyle(NetTL, NetTLColor);


End;

Reply With Quote
 
  #2 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,099 since Apr 2013
Thanks: 377 given, 1,345 received

Fobos,

you can store the time or DateTime in a variable when your conditions are met. At the same location within the code and before (!) you update this variable you store the value of that variable in another variable. In case you need to look back further than a few occurrences you might want to consider using a vector to store the previous values.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #3 (permalink)
Ukraina
 
 
Posts: 15 since Aug 2010
Thanks: 5 given, 0 received



ABCTG View Post
Fobos,

you can store the time or DateTime in a variable when your conditions are met. At the same location within the code and before (!) you update this variable you store the value of that variable in another variable. In case you need to look back further than a few occurrences you might want to consider using a vector to store the previous values.

Regards,

ABCTG

Tell me how to save DateTime into a variable?

Reply With Quote
 
  #4 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,099 since Apr 2013
Thanks: 377 given, 1,345 received

Fobos,

these two links should get you going:
DateTime Class
BarDateTime (Reserved Word)

Regards,

ABCTG


Fobos View Post
Tell me how to save DateTime into a variable?


Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #5 (permalink)
Ukraina
 
 
Posts: 15 since Aug 2010
Thanks: 5 given, 0 received


ABCTG View Post
Fobos,

these two links should get you going:
DateTime Class
BarDateTime (Reserved Word)

Regards,

ABCTG

Thank you so much! With your help, I managed to find the DateTime variable. Now I am looking for a high-low between the two variables DateTime and DateTime [1], but this code displays the high-low bars of these variables. What's my mistake?

 
Code
if (dateTime > Times[1]) and (dateTime <= Times) then begin 

// Reset variables
if (dateTime[1] = Times[1]) then begin
        openRangeHigh = 0;
        openRangeLow  = 99999;
    end;
     
openRangeHigh = MaxList(High, openRangeHigh);
openRangeLow  = MinList(Low,  openRangeLow);
   
        
    end;



tlHigh = openRangeHigh;
tlMid	= (openRangeHigh + openRangeLow) * 0.50;
tlLow 	= openRangeLow;


// Draw the trendlines
	value10 = TL_New_Dt(Times[1] , tlHigh, Times, tlHigh);
	value11 = TL_New_Dt( Times[1], tlMid, Times, tlMid);
	value12 = TL_New_Dt( Times[1], tlLow, Times, tlLow);

Reply With Quote
 
  #6 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,099 since Apr 2013
Thanks: 377 given, 1,345 received

Fobos,

since the code is incomplete I could only guess, but I would suggest using the print reserved word or debugger to find out when you variables are reset and if this happens for example on every bar.

Regards,

ABCTG


Fobos View Post
Thank you so much! With your help, I managed to find the DateTime variable. Now I am looking for a high-low between the two variables DateTime and DateTime [1], but this code displays the high-low bars of these variables. What's my mistake?

 
Code
if (dateTime > Times[1]) and (dateTime <= Times) then begin 

// Reset variables
if (dateTime[1] = Times[1]) then begin
        openRangeHigh = 0;
        openRangeLow  = 99999;
    end;
     
openRangeHigh = MaxList(High, openRangeHigh);
openRangeLow  = MinList(Low,  openRangeLow);
   
        
    end;



tlHigh = openRangeHigh;
tlMid	= (openRangeHigh + openRangeLow) * 0.50;
tlLow 	= openRangeLow;


// Draw the trendlines
	value10 = TL_New_Dt(Times[1] , tlHigh, Times, tlHigh);
	value11 = TL_New_Dt( Times[1], tlMid, Times, tlMid);
	value12 = TL_New_Dt( Times[1], tlLow, Times, tlLow);


Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #7 (permalink)
Ukraina
 
 
Posts: 15 since Aug 2010
Thanks: 5 given, 0 received


ABCTG View Post
Fobos,

since the code is incomplete I could only guess, but I would suggest using the print reserved word or debugger to find out when you variables are reset and if this happens for example on every bar.

Regards,

ABCTG


 
Code
Inputs:
       vTL(3),
       High_Color(Red),		
	Mid_Color(RGB(255, 128, 0)),		
	Low_Color(blue),			
	High_Line_Tickness(2),				
	Mid_Line_Tickness(1),				
	Low_Line_Tickness(2),				
	High_Line_Style(2),					
	Mid_Line_Style(3),					
	Low_Line_Style(2);	



Variables:


Times(0),
var0(0),
vTLValue(0),
openRangeHigh(0), 
openRangeLow(999999),
tlHigh(0), 
tlLow(0), 
tlMid(0);


begin

var0 = Volume ;
var0 = Ticks ;

vTLValue = TL_GetEndVal(vTL);
If ( var0 > vTLValue) then
Times = DateTime;
end;

if (dateTime > Times[1]) and (dateTime <= Times) then begin 

// Reset variables
if (dateTime[1] = Times[1]) then begin
        openRangeHigh = 0;
        openRangeLow  = 99999;
    end;
     
openRangeHigh = MaxList(High, openRangeHigh);
openRangeLow  = MinList(Low,  openRangeLow);
   
        
    



tlHigh = openRangeHigh;
tlMid	= (openRangeHigh + openRangeLow) * 0.50;
tlLow 	= openRangeLow;


// Draw the trendlines
	value10 = TL_New_Dt(Times[1] , tlHigh, Times, tlHigh);
	value11 = TL_New_Dt( Times[1], tlMid, Times, tlMid);
	value12 = TL_New_Dt( Times[1], tlLow, Times, tlLow);
	
	// Change colour of the lines
	TL_SetColor(value10, High_Color);
	Tl_SetColor(value11, Mid_Color);
	TL_SetColor(value12, Low_Color);
	
	// Change the style of the lines
	TL_SetStyle(value10, High_Line_Style);
	TL_SetStyle(value11, Mid_Line_Style);
	TL_SetStyle(value12, Low_Line_Style);
end;

Reply With Quote
 
  #8 (permalink)
Ukraina
 
 
Posts: 15 since Aug 2010
Thanks: 5 given, 0 received

ABCTG, Thank you! Understood the code, fixed it.

Reply With Quote

Reply



futures io > > > > > How to determine the time of the current variable and the previous one.

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
 

Webinar: The Seven Most Effective Trading Setups w/Peter Davies @ Jigsaw

Oct 17
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Static Variable from Pre-defined variable jrobinson3002 MetaQuotes MetaTrader MQL Programming 1 April 15th, 2015 09:15 PM
question: do something IF current bar (or previous bar) is LLV choubix AmiBroker 1 April 9th, 2015 03:34 PM
Retrieve previous day's close and current day's open on intraday chart mandelmus EasyLanguage Programming 1 February 26th, 2015 03:53 PM
current and previous Bar print highs/low above bars on chart Guss NinjaTrader 0 February 13th, 2014 11:28 AM
Vol Indicator / method of comparing current volume to previous days? Gary NinjaTrader Programming 5 November 2nd, 2010 11:34 AM


All times are GMT -4. The time now is 02:12 PM. (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