Trying to set trailing stop to be two ticks below the low>> HELP! - NinjaTrader Programming | futures io social day trading
futures io futures trading


Trying to set trailing stop to be two ticks below the low>> HELP!
Updated: Views / Replies:1,395 / 22
Created: by budfox 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
 

Trying to set trailing stop to be two ticks below the low>> HELP!

  #1 (permalink)
Membership Temporarily Revoked
Toronto
 
Futures Experience: Beginner
Platform: Sierra
Broker/Data: MB
Favorite Futures: ES
 
Posts: 313 since Jun 2013
Thanks: 182 given, 58 received

Trying to set trailing stop to be two ticks below the low>> HELP!

Hi there,

I am hoping more experienced futures.io (formerly BMT) members such as @Beljevina @bukkan @ratfink @sam028 @vvhg @KennyK @vantojo @ would be kind enough to provide some assistance.

I am brand new to the world of coding, so please be a bit patient with me.

My objective is to have a profit target that is 1 ATR below the low of the entry candle (Short).

I developed the bulk of the strategy in the wizard , but I was informed by NT staff, the wizard does not have the ability to subtract the ATR, and has to be manually coded.

If someone could be so kind as to show me how to manually alter the code I would greatly appreciate it.

I would be more than happy to PM you my code.

Thank You,

BF.


Last edited by budfox; September 14th, 2014 at 03:33 PM.
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)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,331 since Jun 2009
Thanks: 3,539 given, 3,947 received


Not compiled nor tested but something like this :
 
Code
                            
int AtrPeriod=14;

SetProfitTarget(CalculationMode.Price,Low[0]-ATR(AtrPeriod)[0]); 

Success requires no deodorant! (Sun Tzu)
Reply With Quote
The following user says Thank You to sam028 for this post:
 
  #4 (permalink)
Membership Temporarily Revoked
Toronto
 
Futures Experience: Beginner
Platform: Sierra
Broker/Data: MB
Favorite Futures: ES
 
Posts: 313 since Jun 2013
Thanks: 182 given, 58 received


sam028 View Post
Not compiled nor tested but something like this :
 
Code
                            
int AtrPeriod=14;

SetProfitTarget(CalculationMode.Price,Low[0]-ATR(AtrPeriod)[0]); 

Hello Sam, @sam028

Thank you so much for providing me with this code. I am trying my best to learn C#.

Just curious, have you ever experienced a situation where there was a particular model, that you could not code/backtest?

Have a great day!

BF

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 42 since Jul 2013
Thanks: 25 given, 1 received

So this thread seems to be on a similar topic ...

I'm looking to use the "Percent Trailing" code for easylanguage and turn it into a "point trailing" code. This is what the % trailing looks like:

 
Code
inputs: 
	PositionBasis( true ), 
	FloorAmt( 1 ), 
	TrailingPct( 20 ) ;                              

if PositionBasis then
	SetStopPosition
else
	SetStopShare ;

SetPercentTrailing( FloorAmt, TrailingPct ) ;
Now what I'm looking to do is substitute "FloorAmt" with something like "PointAmt" (<-- not a reserved word) and "SetPercentTrailing" with "SetPointTrailing" (<--- also not a reserved word).

I've looked at the reserved words and can't seem to find a solution to this. Does anyone have an idea of how I could go about coding this? ANY info would be very much appreciated!

thanks,
brandon

Reply With Quote
 
  #6 (permalink)
Market Wizard
Cleveland Ohio/United States
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: various
Favorite Futures: futures
 
Posts: 2,322 since Jul 2012
Thanks: 1,092 given, 4,238 received
Forum Reputation: Legendary


djvie11 View Post
So this thread seems to be on a similar topic ...

I'm looking to use the "Percent Trailing" code for easylanguage and turn it into a "point trailing" code. This is what the % trailing looks like:

 
Code
inputs: 
	PositionBasis( true ), 
	FloorAmt( 1 ), 
	TrailingPct( 20 ) ;                              

if PositionBasis then
	SetStopPosition
else
	SetStopShare ;

SetPercentTrailing( FloorAmt, TrailingPct ) ;
Now what I'm looking to do is substitute "FloorAmt" with something like "PointAmt" (<-- not a reserved word) and "SetPercentTrailing" with "SetPointTrailing" (<--- also not a reserved word).

I've looked at the reserved words and can't seem to find a solution to this. Does anyone have an idea of how I could go about coding this? ANY info would be very much appreciated!

thanks,
brandon

Try SetDollarTrailing. But, both of the trailing functions will give overly optimistic results, unless you use LIBB at the 1 tick level. Personally, I'd avoid both of them.

If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
Reply With Quote
 
  #7 (permalink)
Trading Apprentice
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 42 since Jul 2013
Thanks: 25 given, 1 received


kevinkdog View Post
Try SetDollarTrailing. But, both of the trailing functions will give overly optimistic results, unless you use LIBB at the 1 tick level. Personally, I'd avoid both of them.

Gotcha, thanks for the suggestion!

I also just got the below code to work too, if anyone needs it


Quoting 
PositionBasis( true ),
TrailingPts ( 1 ),
TrailingPct ( 50 ) ;


Reply With Quote
 
  #8 (permalink)
Market Wizard
Cleveland Ohio/United States
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: various
Favorite Futures: futures
 
Posts: 2,322 since Jul 2012
Thanks: 1,092 given, 4,238 received
Forum Reputation: Legendary


djvie11 View Post
Gotcha, thanks for the suggestion!

I also just got the below code to work too, if anyone needs it

Just don't believe the results. Once you see them, you will certainly want to believe them.

If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
Reply With Quote
The following user says Thank You to kevinkdog for this post:
 
  #9 (permalink)
Trading Apprentice
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 42 since Jul 2013
Thanks: 25 given, 1 received


kevinkdog View Post
Just don't believe the results. Once you see them, you will certainly want to believe them.

Kevin -

I agree with you - in my past experience these results were much, muuuuch better than how the strategy actually performed in the live market. What's your opinion of this occurrence? Slippage? The trailingPct not actually being able to see the fluctuations of the market in real-time?

If so, wouldn't using the back-testing resolution of "Use look-inside-bar Back Testing" be of use in this situation?

thanks
-brandon

Reply With Quote
 
  #10 (permalink)
Market Wizard
Cleveland Ohio/United States
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: various
Favorite Futures: futures
 
Posts: 2,322 since Jul 2012
Thanks: 1,092 given, 4,238 received
Forum Reputation: Legendary



djvie11 View Post
Kevin -

I agree with you - in my past experience these results were much, muuuuch better than how the strategy actually performed in the live market. What's your opinion of this occurrence? Slippage? The trailingPct not actually being able to see the fluctuations of the market in real-time?

If so, wouldn't using the back-testing resolution of "Use look-inside-bar Back Testing" be of use in this situation?

thanks
-brandon

Yes, as I previously mentioned, you can get accurate results if you use Look Inside Bar Backtesting at the 1 tick level. But that usually means you can only test 6 months back, unless you have a tick database stored on your PC.

If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
Reply With Quote
The following user says Thank You to kevinkdog for this post:

Reply



futures io > > > > > Trying to set trailing stop to be two ticks below the low>> HELP!

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

July Journal Challenge w/$1100 in prizes from TopstepTrader

July
 

An Afternoon with FIO member Softsoap

Elite only

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

August
 

Extended Ask Me Anything w/Brett Steenbarger

Elite only

Prototyping Python Strategies (part 3) w/Ran Aroussi

Elite only

Brannigan Barrett w/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
CLICK HERE if you are landlord>>> Creditor trying to garnish my precious rent budfox Off-Topic 16 May 12th, 2014 11:25 AM
ACD System>>>A & C Values for the ES budfox Emini Index Futures Trading 3 October 28th, 2013 04:20 PM
Difference in simulator trading the ES and live trading with a small account>>> budfox Traders Hideout 8 July 6th, 2013 10:59 PM
BLUELINE DELIGHT >>>Intraday Trading Strategy Guide<<< Gabriyele The Elite Circle 407 May 30th, 2013 07:29 AM
TIP : Search for free NinjaTrader Indicator on BMT ? >> How to use our searchtools ! max-td Beginners and Introductions 2 July 19th, 2010 06:16 AM


All times are GMT -4. The time now is 08:40 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-07-24 in 0.13 seconds with 19 queries on phoenix via your IP 54.146.1.178