Adding 2nd target - NinjaTrader Programming | futures io social day trading
futures io futures trading


Adding 2nd target
Updated: Views / Replies:1,222 / 8
Created: by Ryanb Attachments:1

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
 

Adding 2nd target

  #1 (permalink)
Elite Member
Netherlands
 
Futures Experience: Advanced
Platform: none
Favorite Futures: Stocks
 
Ryanb's Avatar
 
Posts: 196 since Sep 2010
Thanks: 117 given, 353 received

Adding 2nd target

Hi there,

i have made a strategy in the strategy wizard and i wanted to add an 2nd contract with a higher target, but when i add the target it wont work, aldough the code seems to be right (i can adjust the settings when starting up the strategy, and no errors occur.)

What i did was simply copying the current target and stop and made it target 2 and stop 2. can someone tell me what i need to do more?

I've watched big mikes advanced strategy coding video but if i do his part of coding for the stops NT is giving errors all over the place.

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
Florida
 
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: CL, NQ, NG
 
Posts: 456 since Jun 2009
Thanks: 1,359 given, 383 received


Ryan,

You need to tell us if you're on 6.5 or 7 and the "type" of entry syntax you're using... There are different methods.

ie EnterLong()...

kz

Reply With Quote
The following user says Thank You to zeller4 for this post:
 
  #4 (permalink)
Elite Member
Netherlands
 
Futures Experience: Advanced
Platform: none
Favorite Futures: Stocks
 
Ryanb's Avatar
 
Posts: 196 since Sep 2010
Thanks: 117 given, 353 received

Hi there,

i use this entry:

EnterLong(DefaultQuantity,
"");

and i`m coding in NT 7

This is my current stop and profit code, it does work but uses only the first target.


Quoting 

[Description(
"")]
[GridCategory(
"Parameters")]
publicint Target1
{
get { return Profit1; }
set { Profit1 = Math.Max(1, value); }
}
[Description(
"")]
[GridCategory(
"Parameters")]
publicint Target2
{
get { return Profit2; }
set { Profit2 = Math.Max(1, value); }
}

[Description(
"")]
[GridCategory(
"Parameters")]
publicint Stop1
{
get { return stop1; }
set { stop1 = Math.Max(1, value); }
}

[Description(
"")]
[GridCategory(
"Parameters")]
publicint Stop2
{
get { return stop2; }
set { stop2 = Math.Max(1, value); }


Reply With Quote
 
  #5 (permalink)
Elite Member
Near the BEuTiFULL Horse Shoe
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 176 received

Please supply screen shots of the code working (print statements for entrys please), both versions with and without the second target, and is there any errors in the compile or the control centre log???

TJ

Reply With Quote
The following user says Thank You to Trader.Jon for this post:
 
  #6 (permalink)
Elite Member
Netherlands
 
Futures Experience: Advanced
Platform: none
Favorite Futures: Stocks
 
Ryanb's Avatar
 
Posts: 196 since Sep 2010
Thanks: 117 given, 353 received

Thank you guy`s for the support!

when i start the strategy this stands in the outputwindow:

Quoting 
**NT** Enabling NinjaScript strategy 'Slingshot/0070cb6b45cc4b76ba388ab3d83877ae' : On starting a real-time strategy - StrategySync=WaitUntilFlat SyncAccountPosition=True EntryHandling=UniqueEntries EntriesPerDirection=2 StopTargetHandling=ByStrategyPosition ErrorHandling=StopStrategyCancelOrdersClosePositions ExitOnClose=False Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=False CancelExitOrdersOnDisable=True MaxRestarts=4 in 5 minutes

in the ninjascript editor it has absolutely no errors at all.

Screenshot added of the strategy that has 2 entry`s and 2 stops.
the other system with 1 stop is exactly the same but then without the 2 entry`s

Attached Thumbnails
Adding 2nd target-screenshot.jpg  
Reply With Quote
 
  #7 (permalink)
Elite Member
Near the BEuTiFULL Horse Shoe
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 176 received

I will have to watch for comment, but I 'think' you can only use 1 value for StopLoss in NT (without using custom code) ... you can check this out if you swap around the values for Stop1 and Stop2 and see which gets used. ...

TJ

Reply With Quote
The following user says Thank You to Trader.Jon for this post:
 
  #8 (permalink)
Elite Member
Dallas, TX
 
Futures Experience: Beginner
Platform: Ninjatrader
Broker/Data: Zen-Fire
Favorite Futures: ZN, 6E
 
gulabv's Avatar
 
Posts: 284 since May 2010
Thanks: 159 given, 155 received

ryanb,

Are you trying to setup 2 orders with different profit targets and stop loss? If so you need to give each entry order a name within the double quotes when you call EnterLong and then associate that order name with the respective exit order calls to use target1 and stop1, target2 and stop2. This will associate your different PT and SL with each order.

hope that helps,
gulabv

Reply With Quote
The following user says Thank You to gulabv for this post:
 
  #9 (permalink)
Elite Member
Netherlands
 
Futures Experience: Advanced
Platform: none
Favorite Futures: Stocks
 
Ryanb's Avatar
 
Posts: 196 since Sep 2010
Thanks: 117 given, 353 received

thanks gulabv,

i wanted to create one entry and 2 targets, but i just made 2 entry`s on 1 signal with 2 diffirent names and that did the trick!

now i`m going to set a break even on it as well

Reply With Quote

Reply



futures io > > > > > Adding 2nd target

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a 2nd Toolbar on a NT chart? fosch NinjaTrader Programming 6 October 6th, 2016 01:38 PM
Radioactive Water Found in 2nd Reactor at Japan Plant Quick Summary News and Current Events 0 March 25th, 2011 07:40 PM
Re enter BE+1 2nd trade after it is stopped emini_Holy_Grail Psychology and Money Management 11 February 19th, 2011 10:33 PM
Adding SMI2 to Dspotter Todd NinjaTrader Programming 1 September 24th, 2009 08:16 PM


All times are GMT -4. The time now is 11:20 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-12-16 in 0.15 seconds with 20 queries on phoenix via your IP 54.226.34.209