help needed yHOD values and trendline drawstarttime issues for todays chart - TradeStation | futures io social day trading
futures io futures trading


help needed yHOD values and trendline drawstarttime issues for todays chart
Updated: Views / Replies:932 / 1
Created: by Scalpin 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 90,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 dont 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
 

help needed yHOD values and trendline drawstarttime issues for todays chart

  #1 (permalink)
Trading Apprentice
Mound, MN
 
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: emini ES
 
Posts: 3 since Feb 2016
Thanks: 0 given, 0 received

help needed yHOD values and trendline drawstarttime issues for todays chart

Hi, I have coded a Yesterday HOD indicator that draws from my specified start time and has an alert associated with a cross over of YHOD. HOWEVER, I want the YHOD timeframe to be regular trading hours, 0830-1500 central, but draw the lines from 0700 to 1600 on todays chart. When I put in the specified values into my Vector time (yesterday) and DrawStartTime (today) it will only draw the line correctly if I make the DrawStartTime later then yesterdays calculation timeframe. For example, if the calculation timefram is 0830-1500, I can't have my start my drawstarttime earlier than 0835 if I want the trendline to plot correctly on todays chart, otherwise it is not horizontal.

Any help would be appreciated!

Here is my code: I want the draw start time to be 0700-1600 on todays chart


{This indicator is designed to plot the period high and low for a time period set by
the "StartTime" and "EndTime" inputs. The OHLCV calculations are reset when the new
time period starts as evaluated by the "ResetCalcs" calculations.

This indicator is intended for application only to intraday bars (tick or time-
based).

Commentary on the use of vectors for OHLCV, along with calculation explanations,
can be found in the "OHLCVCollection" function.

*** This indicator was customized to allow the start and ending times of when
the trend lines are draw can be controlled with inputs and the trend line
values are labeled.}

{ code will use classes from these namespaces }
using elsystem ;
using elsystem.collections ;

inputs:
int NumSubSessionsAgo( 1), { number of sub-sessions ago; use zero to refer to
the current sub-session }
int StartTime( 0830), { start time for OHLCV calculations }
int EndTime( 1500), { end time for OHLCV calculations }

int DrawStartTime( 0835), // *** user input to control when trend lines start
int DrawEndTime( 1600) ; // *** user input to control when trend lines end

variables:
Vector OHLCV_Vector( NULL ), { this is the vector that will be passed by
reference to the function OHLCVCollection; it will hold all the OHLCV values }
Vector HighVector( NULL ), { High Prices }
bool ResetCalcs( false ),
bool IncludeThisBar( false ),
int RtnValOrErrorCode( 0 ), { variable to hold the value returned by call to
OHLCVCollection function }
intrabarpersist bool ValuesAvailable( false ), { used to ensure that there is
enough data in the vector before requesting a value }
double SubSessionHigh( -1 ), { holds High of NumSessionsAgo }

HighTLID (0),
Lev1Txt (0);


// *** Change from Init to InitializeComponent so this code runs
// first thing before the OHLCVCollections function does, else we
// we will get an object not found error
method override void InitializeComponent() begin

if BarType >= 2 then
RaiseRuntimeError( "Price Channel (Time-based) can be applied to " +
"intraday bars only." ) ;

OHLCV_Vector = new Vector ;
HighVector = new Vector ;

end ;

{ condition upon which OHLCV values will be reset for next period }
ResetCalcs = ( Time > StartTime and Time[1] <= StartTime )
or ( Time > StartTime and Time[1] > Time )
or ( Time[1] > Time and StartTime > Time[1] ) ;

{ IncludeThisBar is passed in to OHLCVCollection to designate whether this bar is to
be used in the OHLCV calcultions. This variable is true if the bar falls within the
time frame established by the StartTime and EndTime inputs and false if the bar is
outside the time frame. }

IncludeThisBar = IFFLogic( StartTime > EndTime, Time > StartTime or Time <= EndTime,
Time > StartTime and Time <= EndTime ) ;

RtnValOrErrorCode = OHLCVCollection( ResetCalcs, IncludeThisBar, OHLCV_Vector ) ;

{ set-up HighVector }
once
begin
HighVector = OHLCV_Vector[1] astype Vector ; { [1] = High Price }
end ;

{ only allow retrieval of data once there is enough data loaded into the vector }
once ( RtnValOrErrorCode > NumSubSessionsAgo )
ValuesAvailable = true ;

if ValuesAvailable then begin

SubSessionHigh = HighVector.At( NumSubSessionsAgo ) astype double ;


// *** If the prior bar time is less than the draw start time but the
// current bar time is greater than the draw start time then we are on the
// first bar of the draw time window, so create the high and low trend lines
// as initial points with the start and end values
if Time[1] < DrawStartTime and Time >= DrawStartTime then begin

HighTLID = TL_New( Date, Time, SubSessionHigh, Date, Time, SubSessionHigh ) ;


// Set the high trend line to light blue and the low trend line to purple
Value1 = TL_SetColor( HighTLID, magenta) ;
Value1 = TL_SetSize (HighTLID, 1);
Value1 = Tl_SetStyle (HighTLID,1);



// Create a text label of the subsession high value above the subsession high trend line

end

// *** Else if we have a high trend line ID defined and the time is between
// the draw start and end times, stretch out the end of the high and low
// trend lines to the current date/time
else if HighTLID > 0 and Time >= DrawStartTime and Time <= DrawEndTime then begin
Value1 = TL_SetEnd( HighTLID, Date, SessionendTime(1,1), SubSessionHigh ) ;
end ;

{alert criteria}
If C Crosses Above HighTLID then begin
Alert ("> YHOD - Bullish");

end;
end;

Reply With Quote
 
  #2 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,462 since Apr 2013
Thanks: 224 given, 835 received

Scalpin,

it probably has something to do with at what time that you update the values in the vector, but this is just a guess as your post doesn't include all the code. My guess is that the vector is updated at the beginning of the new tracking period. So if you try to draw a trendline before that, the vector would not yet include the most recent high.

Regards,

ABCTG

Reply With Quote

Reply



futures io > > > > help needed yHOD values and trendline drawstarttime issues for todays chart

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Opening Breakouts and Reversals w/Al Brooks

Elite only
 

Introducing daytradr by Jigsaw, new stand-alone platform

Oct 19
 

RandBots: AutoTrading Bots to diversify your trading

Oct 24
 

TopstepTrader: Profiting Without Risking Your Own Money

Oct 26

Building Open Source Indicators for NT8 w/Fat Tails @ Lizard Indicators

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart trading issues uspilotzzz MultiCharts 5 March 15th, 2016 08:31 PM
Get values from one chart into another rookyjohn NinjaTrader 4 February 3rd, 2016 10:25 PM
Different values for MACD on chart than on MarketWatch? Yakito ThinkOrSwim 8 December 12th, 2013 11:41 AM
plot yesterdays value on todays chart O66NL NinjaTrader 1 May 16th, 2013 04:25 PM
Chart Values/Tool Values Window is missing Big Mike Sierra Chart 17 August 24th, 2012 07:05 PM


All times are GMT -4. The time now is 09:33 AM.

Copyright © 2017 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
Page generated 2017-10-17 in 0.09 seconds with 23 queries on phoenix via your IP 54.156.67.122