What object retrieves stop and target? - NinjaTrader Programming | futures io social day trading
futures io futures trading


What object retrieves stop and target?
Updated: Views / Replies:597 / 18
Created: by Grantx 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
 

What object retrieves stop and target?

  #1 (permalink)
Elite Member
Reading UK
 
Futures Experience: None
Platform: Sierra
Broker/Data: Dorman,cqg
Favorite Futures: My 3 boys
 
Grantx's Avatar
 
Posts: 629 since Oct 2016
Thanks: 506 given, 706 received

What object retrieves stop and target?

Im a little stuck here. If I enter an order with an ATM strategy, then what object do I need to instantiate so that I can retrieve the stop and target levels?

So far I have managed to get VS hooked into Ninja.
Successfully get it to stop in debug mode at OnExecutionUpdate()
However I dont know what object array is carrying the information I need.

Thanks

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
Omer עומר / Israel י
 
Futures Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,212 since Sep 2013
Thanks: 1,567 given, 3,299 received
Forum Reputation: Legendary


// have you looked at this ?

protected override void OnExecution(IExecution execution)
{
Print(execution.Order.LimitPrice);
Print(execution.Order.StopPrice);
}

Reply With Quote
The following user says Thank You to rleplae for this post:
 
  #4 (permalink)
Elite Member
Reading UK
 
Futures Experience: None
Platform: Sierra
Broker/Data: Dorman,cqg
Favorite Futures: My 3 boys
 
Grantx's Avatar
 
Posts: 629 since Oct 2016
Thanks: 506 given, 706 received


rleplae View Post
// have you looked at this ?

protected override void OnExecution(IExecution execution)
{
Print(execution.Order.LimitPrice);
Print(execution.Order.StopPrice);
}

I tried it but compiler doesnt recognise it. I think that might be a NT7 interface. NT8 exposes the actual order object.

I foiund this page which Im scanning through:
NinjaTrader 8

Its been a while since Ive programmed though so this is going to take time .... and pain

Reply With Quote
 
  #5 (permalink)
Elite Member
Omer עומר / Israel י
 
Futures Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,212 since Sep 2013
Thanks: 1,567 given, 3,299 received
Forum Reputation: Legendary


Grantx View Post
I tried it but compiler doesnt recognise it. I think that might be a NT7 interface. NT8 exposes the actual order object.

I foiund this page which Im scanning through:
NinjaTrader 8

Its been a while since Ive programmed though so this is going to take time .... and pain

yes yes yes
i'm on 7 sorry

Reply With Quote
 
  #6 (permalink)
Elite Member
Reading UK
 
Futures Experience: None
Platform: Sierra
Broker/Data: Dorman,cqg
Favorite Futures: My 3 boys
 
Grantx's Avatar
 
Posts: 629 since Oct 2016
Thanks: 506 given, 706 received

I think it would be something like this, I havent tested it thought my brain is starting to hurt. Will try this weekend. rleplae does it look right to you?

Order stopOrder;
double _pricestop = stopOrder.StopPrice

NinjaTrader 8

Reply With Quote
 
  #7 (permalink)
Elite Member
San Francisco, CA
 
Futures Experience: Advanced
Platform: IB-TWS, Ninja, Wave59, R
Broker/Data: IB, IQFeed
Favorite Futures: ZB
 
Posts: 34 since Sep 2013
Thanks: 0 given, 21 received

Look here. https://ninjatrader.com/support/helpGuides/nt8/en-us/order.htm

you have to define a variable first like this: private Order stopOrder1 = null;

then when you lace your order you can do it like this: stopOrder1 = ExitShortStopMarket(double stopPrice);

(you can find the order methods here: https://ninjatrader.com/support/helpGuides/nt8/en-us/order_methods.htm)

then you can access it like this: stopOrder1.StopPrice


Last edited by marpol; April 7th, 2017 at 04:16 PM. Reason: correct links and be more clear
Reply With Quote
 
  #8 (permalink)
Elite Member
Reading UK
 
Futures Experience: None
Platform: Sierra
Broker/Data: Dorman,cqg
Favorite Futures: My 3 boys
 
Grantx's Avatar
 
Posts: 629 since Oct 2016
Thanks: 506 given, 706 received


marpol View Post
Look here. https://ninjatrader.com/support/helpGuides/nt8/en-us/

you have to define a variable first like this: private Order stopOrder1 = null;

then when you lace your order you can do it like this: stopOrder1 = "enter your order here";

then you can access it like this: stopOrder1.StopPrice

Im not sure what youve done there. Youre setting an order object to a string value?
Basically what I want to do is:

1. Create an event handler on executionupdate (or if there is a better way)
2. When the event is fired, instantiate an order object and retrieve the stop and limit levels.

My question is how do I get the current order object and what if its being managed by an atm strategy?

Reply With Quote
 
  #9 (permalink)
Elite Member
San Francisco, CA
 
Futures Experience: Advanced
Platform: IB-TWS, Ninja, Wave59, R
Broker/Data: IB, IQFeed
Favorite Futures: ZB
 
Posts: 34 since Sep 2013
Thanks: 0 given, 21 received


Grantx View Post
Im not sure what youve done there. Youre setting an order object to a string value?
Basically what I want to do is:

1. Create an event handler on executionupdate (or if there is a better way)
2. When the event is fired, instantiate an order object and retrieve the stop and limit levels.

My question is how do I get the current order object and what if its being managed by an atm strategy?

Ok so I am a little bit confused...kind of. So to start here is the NT8 Reference page for ATM in ninjascript https://ninjatrader.com/support/helpGuides/nt8/en-us/strategy.htm

1) If you put on the ATM strat then don't you know the stop and target levels?

2) It seams like most people use a ninjascript to enter a position and then (maybe) use an ATM strat as and exit.....it sounds like you want to do the opposite? (not that is wrong...just trying to understand).

3) I have never used and ATM stratagy ever before so I have never used them in an NT script. I am an approved NinjaTrader EcoSystem Partner so I can probably get an answer for you if I understand better.


So in NT8 the order info is stored in an order object. So you can define your own order object like I showed before: private Order myOrder1;

then if you use ninjasript to place a trade then you would do something like this: myOrder1 = "Place your Trade";
then the Order Object myOrder1 will point to that order so you can access it in your program. When I place stop orders in a NT script i always tell NT what the stop price should be....so I really never need to access myOrder1.StopPrice because i already know what i set it to in the first place.

Maybe if your ok with telling us what you are trying to do I/we can point you in the right direction. Or pm me if you need to make it private.

Reply With Quote
 
  #10 (permalink)
Elite Member
Reading UK
 
Futures Experience: None
Platform: Sierra
Broker/Data: Dorman,cqg
Favorite Futures: My 3 boys
 
Grantx's Avatar
 
Posts: 629 since Oct 2016
Thanks: 506 given, 706 received



marpol View Post
Ok so I am a little bit confused...kind of. So to start here is the NT8 Reference page for ATM in ninjascript https://ninjatrader.com/support/helpGuides/nt8/en-us/strategy.htm

1) If you put on the ATM strat then don't you know the stop and target levels?

2) It seams like most people use a ninjascript to enter a position and then (maybe) use an ATM strat as and exit.....it sounds like you want to do the opposite? (not that is wrong...just trying to understand).

3) I have never used and ATM stratagy ever before so I have never used them in an NT script. I am an approved NinjaTrader EcoSystem Partner so I can probably get an answer for you if I understand better.


So in NT8 the order info is stored in an order object. So you can define your own order object like I showed before: private Order myOrder1;

then if you use ninjasript to place a trade then you would do something like this: myOrder1 = "Place your Trade";
then the Order Object myOrder1 will point to that order so you can access it in your program. When I place stop orders in a NT script i always tell NT what the stop price should be....so I really never need to access myOrder1.StopPrice because i already know what i set it to in the first place.

Maybe if your ok with telling us what you are trying to do I/we can point you in the right direction. Or pm me if you need to make it private.

Hi Marpol,
Sorry Im not being very clear with what I am trying to achieve.
This is my first programming in a while so Im starting with something simple to get my head back into it.

At the moment, I do a screenshot after every trade has completed. I mark what my trade parameters were by drawing the entry, stop and target levels with a line. This helps my post analysis.
I want to speed up this process by automating the lines on the chart (with text showing the stop amount and target amount), so that when the trade is over all I have to do is quickly type in a brief analysis and then save the chart.

I really just need to get those levels and then my next step is figuring out how to draw a line on the chart at those levels.

Reply With Quote

Reply



futures io > > > > > What object retrieves stop and target?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Battlestations: Show us your trading desks and win $750 in prizes

August
 

Ask Me Anything (AMA) w/Rod Casilli @ Collective2

Aug 23
 

Prototyping Python Strategies (part 3, Live Trading) w/Ran Aroussi [1PM ET]

Elite only
 

Develop Strategies and Perfect Execution w/Brannigan Barrett @ Axia Futures

Elite only

Introduction to Phillip Capital futures brokerage services

Aug TBD

How Monte Carlo Analysis Can Help Your Trading w/Kevin Davey

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Object reference not set to an instance of an object. gomad NinjaTrader Programming 11 December 22nd, 2014 08:09 AM
Scalping with a target less than stop Twiddle Traders Hideout 19 November 20th, 2013 01:00 AM
OnBarUpdate Error Object reference not set to an instance of an object ECI Ed NinjaTrader Programming 2 August 6th, 2013 03:59 PM
Trailing stop and Target on Idicator Help bdd069 Elite Automated Trading 4 February 10th, 2013 07:38 PM
need help :: cant fix :: Object reference not set to an instance of an object Trader.Jon NinjaTrader Programming 9 November 3rd, 2010 10:55 AM


All times are GMT -4. The time now is 05:17 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-08-20 in 0.14 seconds with 19 queries on phoenix via your IP 54.162.111.247