C# Help (ToTime) - NinjaTrader Programming | futures io social day trading
futures io futures trading


C# Help (ToTime)
Updated: Views / Replies:999 / 4
Created: by patbateman 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
 

C# Help (ToTime)

  #1 (permalink)
Elite Member
NY, NY
 
Futures Experience: None
Platform: T4, NinjaTrader
Favorite Futures: All!
 
patbateman's Avatar
 
Posts: 235 since Mar 2012
Thanks: 113 given, 197 received

C# Help (ToTime)

I apologize if this is a basic question...

I'm trying to make an indicator that displays the value of another indicator at a specific time. So, for example, every day at 9:30 in the morning, the second indicator will display a horizontal line of the value of the first indicator at 9:30. Then for the following day, it will display a new value for the 9:30 value of the first indicator.

I've tried ToTime and GetBar, no luck.

"A Jedi's strength flows from the force."
-Yoda
Reply With Quote
 
  #2 (permalink)
Elite Member
Northern Germany
 
Futures Experience: Intermediate
Platform: NT
Favorite Futures: FDAX, CL
 
vvhg's Avatar
 
Posts: 1,583 since Mar 2011
Thanks: 1,016 given, 2,817 received


patbateman View Post
I apologize if this is a basic question...

I'm trying to make an indicator that displays the value of another indicator at a specific time. So, for example, every day at 9:30 in the morning, the second indicator will display a horizontal line of the value of the first indicator at 9:30. Then for the following day, it will display a new value for the 9:30 value of the first indicator.

I've tried ToTime and GetBar, no luck.

Just call the indicator with barsago, type SMA into the NT help, there should be an example. As this number will change with each new bar, vou have to recalculate, to do so you can use barssincesession or similar methods.

Vvhg

Hic Rhodos, hic salta.
Reply With Quote
 
  #3 (permalink)
Elite Member
NY, NY
 
Futures Experience: None
Platform: T4, NinjaTrader
Favorite Futures: All!
 
patbateman's Avatar
 
Posts: 235 since Mar 2012
Thanks: 113 given, 197 received


I guess I'm not that great at C#...

Unfortunately Ninja will not allow a variable in the bars ago parameter. (Example: Close[x])

There has to be a way to make something like OHLC, but for an indicator and not a data series; the time could be entered on the indicator...

I've tried totime if statements that try to put the value into a variable, but no cigar.


"A Jedi's strength flows from the force."
-Yoda
Reply With Quote
 
  #4 (permalink)
Market Wizard
New Orleans, La (Mardi Gras City)
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Ninjatrader / Optimus Futures / AmpFutures
Favorite Futures: ES / 6E / 6B / CL
 
DavidHP's Avatar
 
Posts: 1,106 since Aug 2009
Thanks: 2,108 given, 1,622 received
Forum Reputation: Legendary


patbateman View Post
I apologize if this is a basic question...

Maybe this will help.
You will need to define StartTime, EndTime, startBar, etc.

This is basic code that uses a time slot (between two times start and end).
When the bar is between those two times, the line code is executed.
The startBar is a method to allow it to fire once and be reset when it is outside of the time slot.

 
Code
if ((ToTime(Time[0]) >= StartTime) && (ToTime(Time[0]) < EndTime))
	{
	if (startBar == 0 )
	<Do Something Here Like This>
         // DrawVerticalLine("T"+CurrentBar, 0, Color.Red, lineStyle, lineWidth);
         startBar = 1;	
	}
else
	{
	startBar = 0;
	}

Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Reply With Quote
The following 2 users say Thank You to DavidHP for this post:
 
  #5 (permalink)
Elite Member
NY, NY
 
Futures Experience: None
Platform: T4, NinjaTrader
Favorite Futures: All!
 
patbateman's Avatar
 
Posts: 235 since Mar 2012
Thanks: 113 given, 197 received

Okay...my purpose is that I'm trying to get an indicator that shows one value of another indicator for 24 hours. I'll give this a shot.

I was hoping to somehow take the CurrentDayOHL or anaOHL and modify it for an indicator.

"A Jedi's strength flows from the force."
-Yoda
Reply With Quote

Reply



futures io > > > > > C# Help (ToTime)

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Fundraiser: Feeding Families in Need (ends Dec 17)

December
 

Battlestations! Show us your trading desks w/GFF Brokers ($750 in Prizes)

January
 

An Afternoon With Morad Askar (aka FuturesTrader71)

Elite only
 

TBA w/Brett Steenbarger

Elite only
 

Traders Tax Advice w/Ryan Curran CPA

Elite only
 

Black Swan Events w/Adam Grimes

Elite only
     


Tags
c#, code, data, data series, ema, indicator, indicators, ninjascript, ninjatrader, nt help, ohlc, sma, type, variable

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

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business, 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 2018-12-18 in 0.12 seconds with 13 queries on phoenix