Coding a PercentTrail that works like %Trail, but doesn't execute Intrabar! - EasyLanguage Programming | futures io social day trading
futures io futures trading


Coding a PercentTrail that works like %Trail, but doesn't execute Intrabar!
Updated: Views / Replies:305 / 2
Created: by djvie11 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
 

Coding a PercentTrail that works like %Trail, but doesn't execute Intrabar!

  #1 (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

Coding a PercentTrail that works like %Trail, but doesn't execute Intrabar!

Hi Guys

So I've been going back and forth trying to get this to work. I would love to use the PercentTrailing code with my strategy but I don't want for the order to be submitted intrabar (too many fluctuations). I would like to assess the max run-up of the position and calculate how much that max run-up has come down @ the close of the bar (not intrabar).

I tried to code this multiple ways into my strategy, but everything I've tried works nothing close to adding a "PercentTrailing" to my strategy. My attempts are below. Any suggestions would be greatly appreciated!

1) make it a condition, and when said condition triggers it would exit the position

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

Condition5 = C <  (OpenpositionProfit + DollarAmt) - (MaxpositionProfit * PctTrail) ) ;
2) Then I tried putting this at the end of my code to exit as well:
 
Code
Inputs:
DollarAmt (1),
PctTrail (.25);

IF
(OpenPositionProfit + DollarAmt) < MaxPositionProfit - (MaxPositionProfit * PctTrail) 
THEN 
SetExitOnClose  ;
Again, non of these "solutions" worked like the true SetPercentTrailing code. Any ideas of how to work this on the close of the bar?

Thanks!
Brandon

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)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,410 since Apr 2013
Thanks: 220 given, 801 received
Forum Reputation: Legendary


djvie11,

when the condition for your stop is met you can send an order to close the open position, for example
 
Code
Sell ( "LX" ) next bar market ;
This would issue the order at the end of the bar and you'd get executed around the open of the next bar. Which is to be expected when you send an order at the close.

You could fool your software (and yourself as you will create results that you can't reproduce live) by using "this bar Close" for the order, but this will likely not be the fills you get live.
You could look into custom sessions that would allow you to walk around that problem or to use intrabar order generation, which would give you the ability to close out the position near the actual bar close.

Regards,

ABCTG

Reply With Quote

Reply



futures io > > > > > Coding a PercentTrail that works like %Trail, but doesn't execute Intrabar!

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
fibonacci templates doesn't works alextrd NinjaTrader 4 April 15th, 2015 04:24 PM
Trail Stop Indicator Michael Krall NinjaTrader Programming 2 March 26th, 2014 09:30 AM
Trail Stop Kush NinjaTrader Programming 4 June 14th, 2012 12:01 PM
Execute trade intrabar on bar close indicator spinnybobo NinjaTrader 3 April 2nd, 2012 02:59 PM
Audit Trail of Trades ab456 Traders Hideout 1 November 28th, 2011 02:41 PM


All times are GMT -4. The time now is 05:06 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-27 in 0.08 seconds with 19 queries on phoenix via your IP 54.162.50.232