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,660 / 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!

  #11 (permalink)
Trading Apprentice
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 44 since Jul 2013
Thanks: 26 given, 1 received

hi Kevin

So to reignite this thread -- With % trailing, we know the trailing stops are executed intrabar. My question is - Is there a way to only execute % trailing at the end of the bar, and NOT intrabar?

(even with [Intrabarordergeneration = False] it'll still trigger the order)

thanks in advance for any info!
-Brandon

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


djvie11 View Post
hi Kevin

So to reignite this thread -- With % trailing, we know the trailing stops are executed intrabar. My question is - Is there a way to only execute % trailing at the end of the bar, and NOT intrabar?

(even with [Intrabarordergeneration = False] it'll still trigger the order)

thanks in advance for any info!
-Brandon

If you wrote code that calculated the price you wanted, you could.

Say you were long, and you calculate a price of XXXX to exit. Then it is simply:

if close<XXXX sell this bar at close;

This won't work on last bar of day though.

You could also do something like:

sell next bar at XXXX stop;

where XXXX is calculated based on a percent trailing or whatever you want.

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:
 
  #13 (permalink)
Trading Apprentice
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 44 since Jul 2013
Thanks: 26 given, 1 received



kevinkdog View Post
If you wrote code that calculated the price you wanted, you could.

Say you were long, and you calculate a price of XXXX to exit. Then it is simply:

if close<XXXX sell this bar at close;

This won't work on last bar of day though.

You could also do something like:

sell next bar at XXXX stop;

where XXXX is calculated based on a percent trailing or whatever you want.

Thank you for the response, Kevin!

I'm now trying to make it a condition, but when I try to compile it it's saying "expression expected here." Obviously I'm coding this wrong.

 
Code
Condition1 = C[1] of data2 < SetPercentTrailing( FloorAmt, TrailingPct ) ;

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


djvie11 View Post
Thank you for the response, Kevin!

I'm now trying to make it a condition, but when I try to compile it it's saying "expression expected here." Obviously I'm coding this wrong.

 
Code
Condition1 = C[1] of data2 < SetPercentTrailing( FloorAmt, TrailingPct ) ;

You've got to create your own trailing stop expression. MaxpositionProfit and OpenPositionProfit could be useful.

Maybe if MaxpositionProfit-OpenPositionProfit>1000 //means when your current profit is $1000 less than the maximum profit the position hit at one time...

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:
 
  #15 (permalink)
Trading Apprentice
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 44 since Jul 2013
Thanks: 26 given, 1 received


kevinkdog View Post
You've got to create your own trailing stop expression. MaxpositionProfit and OpenPositionProfit could be useful.

Maybe if MaxpositionProfit-OpenPositionProfit>1000 //means when your current profit is $1000 less than the maximum profit the position hit at one time...

Great idea, Kevin.

I came up with this, but I'm having trouble figuring out the command to cover the position at the end. I used SetStopPosition but that's not correct.

 
Code
Inputs:
PctTrail (.25),
DollarAmt (20);

Condition1 = MaxpositionProfit > DollarAmt ;
Condition2 = MaxpositionProfit < MaxpositionProfit - (MaxPositionProfit * PctTrail);

IF Condition1 AND Condition2
THEN 
SetStopPosition  ;

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


djvie11 View Post
Great idea, Kevin.

I came up with this, but I'm having trouble figuring out the command to cover the position at the end. I used SetStopPosition but that's not correct.

 
Code
Inputs:
PctTrail (.25),
DollarAmt (20);

Condition1 = MaxpositionProfit > DollarAmt ;
Condition2 = MaxpositionProfit < MaxpositionProfit - (MaxPositionProfit * PctTrail);

IF Condition1 AND Condition2
THEN 
SetStopPosition  ;



If you want to exit right when this is evaluated as true, then

sell this bat at close;

would work (except for last bar of day)

or

sell next bar at market;

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


kevinkdog View Post
If you want to exit right when this is evaluated as true, then

sell this bat at close;

would work (except for last bar of day)

or

sell next bar at market;

Understood.

Is there a command though that would exit both LONG (sell this bar at close) and SHORT (buy to cover at close) positions?

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


djvie11 View Post
Understood.

Is there a command though that would exit both LONG (sell this bar at close) and SHORT (buy to cover at close) positions?


setexitonclose;

but remember it will not work with real money on last bar of day. It works in backtest though.

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:
 
  #19 (permalink)
Trading Apprentice
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 44 since Jul 2013
Thanks: 26 given, 1 received


kevinkdog View Post
setexitonclose;

but remember it will not work with real money on last bar of day. It works in backtest though.

your knowledge is much appreciated, Kevin!

happy trading.

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



kevinkdog View Post
setexitonclose;

but remember it will not work with real money on last bar of day. It works in backtest though.

And for what it's worth - that last bit of code I posted didn't work (It didn't understand the variables). This new code below works.

 
Code
Inputs:
PctTrail (.25),
DollarAmt (20);

IF
(OpenPositionProfit + DollarAmt) < MaxPositionProfit - (MaxPositionProfit * PctTrail) 
THEN 
SetExitOnClose  ;

Reply With Quote

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)

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


All times are GMT -4. The time now is 12:39 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-13 in 0.12 seconds with 19 queries on phoenix via your IP 54.221.93.187