Coding a "Highest High of an open position" - EasyLanguage Programming | futures io social day trading
futures io futures trading


Notices

Coding a "Highest High of an open position"
Updated: Views / Replies:1,868 / 29
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 100,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 "Highest High of an open position"

  #1 (permalink)
Trading for Fun
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 51 since Jul 2013
Thanks: 29 given, 1 received

Coding a "Highest High of an open position"

Hi there!

I was wondering if anyone could point me in the right direction here. I'm looking to code something that references the highest high or lowest low price of an open position.

I know there's
 
Code
Highest (Price, Length) & Lowest (Price, Length)
and then
 
Code
MaxPositionProfit
, but the first references "x number of bars ago," and the 2nd references profit, not the "high/low price" of a currently open position.

Any advice or tips would be greatly appreciated! Much 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)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,846 since Apr 2013
Thanks: 301 given, 1,130 received
Forum Reputation: Legendary


Brandon,

you could convert the MaxPositionProfit back to a price value for example, as you know the point value of the symbol, your position size and the entry price for each trade. This could become problematic in case you scale in and out of positions.
In that case you would have to track the high your self with a variable. You would have to reset the variable when you are flat or once at the beginning of each trade. Then while you are in a trade and every time the high is higher than the value stored in your variable, you would update the variable to store the high.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #4 (permalink)
Market Wizard
Houston, TX
 
Futures Experience: Advanced
Platform: XTrader
Broker/Data: Advantage Futures
Favorite Futures: Energy
 
Posts: 2,624 since Dec 2013
Thanks: 2,106 given, 4,546 received
Forum Reputation: Legendary

Alternatively have a bar counter, every time you enter a trade/send a market order reset the counter, and then just calculate highest(high,barcounter)?

Reply With Quote
The following 2 users say Thank You to SMCJB for this post:
 
  #5 (permalink)
Trading for Fun
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 51 since Jul 2013
Thanks: 29 given, 1 received

Just to revisit this idea, would making the "Highest High or Lowest Low" of a position a variable work? Below is meant to show the Highest or Lowest price of an open position.

ex:
 
Code
Variables:
ioHighestHigh (0),
ioLowestLow   (0);

ioHighestHigh  = Highest (H, EntryPrice) ;
ioLowestLow   = Lowest  (L, EntryPrice) ;

Reply With Quote
 
  #6 (permalink)
Market Wizard
Houston, TX
 
Futures Experience: Advanced
Platform: XTrader
Broker/Data: Advantage Futures
Favorite Futures: Energy
 
Posts: 2,624 since Dec 2013
Thanks: 2,106 given, 4,546 received
Forum Reputation: Legendary

Highest (Function)

The Highest function returns the highest price over a range of bars.

Syntax
Highest(Price, Length)

Returns (Double)
The highest Price found over a range of Length bars.

Parameters

Price
Numeric
Specifies which bar value (price, function, or formula) to evaluate.

Length
Numeric
Sets the number of bars to consider.

For

ioHighestHigh = Highest (H, EntryPrice) ;

to reference the highest high or lowest low price of an open position, EntryPrice would need to be the number of bars since you opened the position.

Reply With Quote
The following 2 users say Thank You to SMCJB for this post:
 
  #7 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,846 since Apr 2013
Thanks: 301 given, 1,130 received
Forum Reputation: Legendary

djvie11,

you could check if using BarsSinceEntry instead of the EntryPrice will give you what you are looking for.

Regards,

ABCTG


djvie11 View Post
Just to revisit this idea, would making the "Highest High or Lowest Low" of a position a variable work? Below is meant to show the Highest or Lowest price of an open position.

ex:
 
Code
Variables:
ioHighestHigh (0),
ioLowestLow   (0);

ioHighestHigh  = Highest (H, EntryPrice) ;
ioLowestLow   = Lowest  (L, EntryPrice) ;


Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #8 (permalink)
Trading for Fun
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 51 since Jul 2013
Thanks: 29 given, 1 received


ABCTG View Post
djvie11,

you could check if using BarsSinceEntry instead of the EntryPrice will give you what you are looking for.

Regards,

ABCTG

Just back to revisit this idea!

So I wrote a variable to make my "Highest High" and "Lowest Low." I did this because I don't want a limitation as to how many bars back it'll reference ( ie, Highest (H, bars back) ;

Here's what I have below. It doesn't seem to be working as I expected and wanted to get some feedback if you guys have the time!
 
Code
Variables:
io_HighestHigh (0),
io_LowestLow   (0);

IF MarketPosition = 0 THEN BEGIN // this is to reset the variable as it's not used to enter into a position
io_HighestHigh = 0 ;
io_LowestLow   = 0 ;
END ; 

IF MarketPosition <> 0 THEN BEGIN
io_HighestHigh  = H of data1 ;
io_LowestLow   = L of data1 ;
IF H of data1 > io_HighestHigh  then io_HighestHigh = H of data1 ;
IF L of data1 < io_LowestLow   then  io_LowestLow   = L of data1 ;
END ;
Does the above make sense? Thanks for your time!

-Brandon

Reply With Quote
 
  #9 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,846 since Apr 2013
Thanks: 301 given, 1,130 received
Forum Reputation: Legendary

Brandon,

when you constantly set the highest high to the High of the bar (and vice versa for the low) while you are in a position:
 
Code
io_HighestHigh  = H of data1 ;
io_LowestLow   = L of data1 ;
How can the check you do within the "if... then"... ever become true?
 
Code
 
IF H of data1 > io_HighestHigh  then io_HighestHigh = H of data1 ;
IF L of data1 < io_LowestLow   then  io_LowestLow   = L of data1 ;
Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #10 (permalink)
Trading for Fun
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 51 since Jul 2013
Thanks: 29 given, 1 received



ABCTG View Post
Brandon,

when you constantly set the highest high to the High of the bar (and vice versa for the low) while you are in a position:
 
Code
io_HighestHigh  = H of data1 ;
io_LowestLow   = L of data1 ;
How can the check you do within the "if... then"... ever become true?
 
Code
 
IF H of data1 > io_HighestHigh  then io_HighestHigh = H of data1 ;
IF L of data1 < io_LowestLow   then  io_LowestLow   = L of data1 ;
Regards,

ABCTG

Ah, good point! I think if I make the highestHigh/LowestLow an average initially (or anything else besides H/L of data1) it should work then.

I appreciate the response!

Reply With Quote

Reply



futures io > > > > > Coding a "Highest High of an open position"

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Fundraiser: Feeding Families in Need (ends Dec 17)

December
 

Battlestations! Show us your trading desks w/GFF Brokers ($750 in Prizes)

January
 

An Afternoon With Morad Askar (aka FuturesTrader71)

Elite only
 

Traders Tax Advice w/Ryan Curran CPA

Elite only
 

Black Swan Events w/Adam Grimes

Elite only
 

TBA w/Brett Steenbarger

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Extremes", "highest/lowest" functions affecting maxbarback LastSyndrome Elite EasyLanguage Automated Trading 3 September 1st, 2012 06:38 AM
Fukushima: "China Syndrome Is Inevitable" ... "Huge Steam Explosions", or "Nuclear Bo Quick Summary News and Current Events 0 November 22nd, 2011 02:50 AM
How to change "Stop Loss" and "Take Profit" in "shElderImpulse" Strategy javed759 NinjaTrader 1 November 1st, 2011 11:44 PM
"misery index" rises to highest since 1983 kbit News and Current Events 0 October 20th, 2011 12:29 PM
Coding required for "High Probability Trading Setups" Manfred MetaQuotes MetaTrader MQL Programming 2 September 9th, 2011 08:10 AM


Tags
abc, average, barssinceentry, boolean flag, code, data, dow, easylanguage, feedback, futures, how to, information, intrabar, intraday, market order, market position, marketposition, multicharts, neoticker, new high, position size, programming, scale in, strategy, tradestation, trading, txt, update, values, variable

All times are GMT -4. The time now is 05:30 PM. (this page content is cached, log in for real-time version)

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business, 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 2018-12-15 in 0.15 seconds with 14 queries on phoenix