Accessing Rectangle Bounds within a strategy - NinjaTrader Programming | futures io social day trading
futures io futures trading


Accessing Rectangle Bounds within a strategy
Updated: Views / Replies:1,078 / 7
Created: by Xav1029 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 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
 

Accessing Rectangle Bounds within a strategy

  #1 (permalink)
Elite Member
Tampa, FL
 
Futures Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: 6E, M6E, 6J
 
Xav1029's Avatar
 
Posts: 1,374 since Dec 2011
Thanks: 1,452 given, 3,354 received

Accessing Rectangle Bounds within a strategy

Got a couple minutes after lunch, so I'll post this question here:

How can I access the chart rectangle bounds from within a strategy? I have fixed text drawn negative bars ago, but it is not visible if you set the margin to 100, only if you scroll. In an indicator, I could easily override the Plot(), but not so much in a strategy.

Edit: I would also need to know how to duplicate the Plot() method ie how to change the position of the string I draw, but delete the previously drawn string.
Thanks in advance

London Calling
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)
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,807 received



Xav1029 View Post
Got a couple minutes after lunch, so I'll post this question here:

How can I access the chart rectangle bounds from within a strategy? I have fixed text drawn negative bars ago, but it is not visible if you set the margin to 100, only if you scroll. In an indicator, I could easily override the Plot(), but not so much in a strategy.

Edit: I would also need to know how to duplicate the Plot() method ie how to change the position of the string I draw, but delete the previously drawn string.
Thanks in advance

Is ChartControl not accessible in a strategy? I'm really not very knowledgeable when it comes to strategies.
If things get complicated inside the strategy, why not instantiate an indicator and call its methods from within the strategy? Cross communication should be no problem at all...

Edit: I'd try this.FindForm().ChartControl
And if you can't override the Plot() method there might still be an eventhandler OnPlot or so...just an idea
Vvhg

Hic Rhodos, hic salta.

Last edited by vvhg; January 18th, 2013 at 04:19 PM.
Reply With Quote
The following user says Thank You to vvhg for this post:
 
  #4 (permalink)
Elite Member
Tampa, FL
 
Futures Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: 6E, M6E, 6J
 
Xav1029's Avatar
 
Posts: 1,374 since Dec 2011
Thanks: 1,452 given, 3,354 received


vvhg View Post
Is ChartControl not accessible in a strateg?, I'm really not very knowledgeable when it comes to strategies.
If things get complicated inside the strategy, why not instantiate an indicator and call its methods from within the strategy? Cross communication should be no problem at all...

Vvhg

@vvhg ChartControl is, but Plot() is not. I need to plot labels for lines (working on my advanced ATM system still ), which is simple overriding the Plot() in indicators, but not in strategies. Right now I have it set up using DrawText, but I am kinda picky and hate the fact that I have to manually scroll my chart to see the text drawn "in the future". I want the label to be visible no matter where I am on the chart. Simple enough overriding Plot() in an indy, but without that tool I am stuck in a strategy with DrawText.

London Calling
Reply With Quote
 
  #5 (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,807 received


Xav1029 View Post
@vvhg ChartControl is, but Plot() is not. I need to plot labels for lines (working on my advanced ATM system still ), which is simple overriding the Plot() in indicators, but not in strategies. Right now I have it set up using DrawText, but I am kinda picky and hate the fact that I have to manually scroll my chart to see the text drawn "in the future". I want the label to be visible no matter where I am on the chart. Simple enough overriding Plot() in an indy, but without that tool I am stuck in a strategy with DrawText.

In that case it might be easiest to call an indicator doing the plot stuff. Either instantiate it or just call individual methods (maybe with the help of an eventhandler?)

If you instantiate the indicator with a pointer to the strategy ("this", as I have done with the vvfutures.io (formerly BMT)AutoPost) you can access all public variables from within the indicator.


Vvhg

Hic Rhodos, hic salta.
Reply With Quote
 
  #6 (permalink)
Elite Member
Tampa, FL
 
Futures Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: 6E, M6E, 6J
 
Xav1029's Avatar
 
Posts: 1,374 since Dec 2011
Thanks: 1,452 given, 3,354 received


vvhg View Post
In that case it might be easiest to call an indicator doing the plot stuff. Either instantiate it or just call individual methods (maybe with the help of an eventhandler?)


Vvhg

@vvhg How do I instantiate a dummy indicator so I can override Plot(), and then how would I access Plot()? I will be plotting on price panel if that helps. I've instantiated indicator before, but the Plot() event doesn't get triggered, so I'm kind of lost on what to do.

London Calling
Reply With Quote
 
  #7 (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,807 received


Xav1029 View Post
@vvhg How do I instantiate a dummy indicator so I can override Plot(), and then how would I access Plot()? I will be plotting on price panel if that helps. I've instantiated indicator before, but the Plot() event doesn't get triggered, so I'm kind of lost on what to do.

I'm not at my computer, so all from the top of my head and partially untested...

Not entirely sure how to instantiate, but I think you would have to use the Add() method in either initialize or onstartup, helpfile should clarify that. Then Plot() should get called just fine. If that works you could access all relevant variables from within indicator Plot() via public strategy variables and forwarding a pointer to the strategy, in that case as a parameter I should think...

Vvhg

Hic Rhodos, hic salta.
Reply With Quote
The following user says Thank You to vvhg for this post:
 
  #8 (permalink)
Elite Member
Tampa, FL
 
Futures Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: 6E, M6E, 6J
 
Xav1029's Avatar
 
Posts: 1,374 since Dec 2011
Thanks: 1,452 given, 3,354 received


vvhg View Post
I'm not at my computer, so all from the top of my head and partially untested...

Not entirely sure how to instantiate, but I think you would have to use the Add() method in either initialize or onstartup, helpfile should clarify that. Then Plot() should get called just fine. If that works you could access all relevant variables from within indicator Plot() via public strategy variables and forwarding a pointer to the strategy, in that case as a parameter I should think...

Vvhg

Thanks buddy I think you are right. Found this on the NT forums, and looks like all you have to do is Add() in Initialize().

Strategy: Plotting from within a NinjaScript Strategy - NinjaTrader Support Forum

London Calling
Reply With Quote
The following 2 users say Thank You to Xav1029 for this post:

Reply



futures io > > > > > Accessing Rectangle Bounds within a strategy

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Trade Markers Xav1029 NinjaTrader Programming 8 November 28th, 2012 06:48 PM
draw rectangle for first hour of market indicator ceramictilepro NinjaTrader Programming 3 August 10th, 2012 03:26 PM
Drawing rectangle at bottom of sceen after each bar RBerry NinjaTrader Programming 6 January 10th, 2012 08:54 AM
Accessing a chart from a strategy richtobey NinjaTrader Programming 3 December 31st, 2010 05:07 AM
Creating a Rectangle with an anchor zeller4 NinjaTrader Programming 4 March 12th, 2010 01:04 AM


All times are GMT -4. The time now is 09:00 PM.

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-12-11 in 0.11 seconds with 19 queries on phoenix via your IP 54.83.122.227