Future Reference to Past Bar - EasyLanguage Programming | futures io social day trading
futures io futures trading


Future Reference to Past Bar
Updated: Views / Replies:1,150 / 23
Created: by Vientomarsol Attachments:11

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
 11  
 
Thread Tools Search this Thread
 

Future Reference to Past Bar

  #21 (permalink)
Trading Apprentice
Port St. Lucie, FL.
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES
 
Posts: 18 since May 2016
Thanks: 10 given, 7 received

One Last Glitch :(

Hello ABGT,

Sorry to bug you again but I have a glitch in my TradeStation ‘Naked Bottom” system which didn’t show-up right away. I have been working on a solution for over a week, and I finally run-out of ideas.

As discussed in our earlier correspondence; my ‘Naked Bottom” exit strategy (for a Long trade) is intended to trigger a Sell when price is < Entry Low [1]. In other words: Sell on a break of the low of the ‘Bar-Before-Entry’.

The code you helped me develop performs as intended except for one flaw.

As indicated on attached Barchart of my ‘Naked Bottom” system, the intended system sequence is as follows:
1. Market Position is MP=0 (Blue Dots on chart) until Entry Signal #1 is received.

2. Entry Signal #1 is received (Red Dot on chart) which initiates MP = 1 (Yellow Dots on chart) and signals a Long Trade.

3. Entry Signal #2 (Red Dot) is received and will continue with the original trade (Still MP = 1), but is expected to re-set the ‘Exit Trigger’ to < Entry Low [1] of Entry #2.

Note: In the case of Entry #2, the < Entry Low [1] of Entry #2 was not breached, and no exit was made (as was expected).

4. Entry Signal #3 (Red Dot) is received and continues the original trade (Still MP = 1), and (as discussed in Item 3 above) the ‘Exit Trigger’ is expected to be re-set to < Entry Low [1] of Entry #3.

Note: In the case of Entry #3, the < Entry Low [1] was breached, but no exit was made. Instead; many bars later, the actual exit (Green Dot) was made on the basis of < Entry Low [1] of Entry #1 (not Entry #3), whereupon Market Position was returned to MP=0 (Blue Dots on chart)

Question / Comment:
• How may I code my ‘Exit Trigger’ to re-calculate to the < Entry Low [1] for each succeeding Entry Signal, rather than the < Entry Low [1] of my initial entry?

Note: I do understand that a re-set depends on the Market Position reverting back to MP=0, when each new Entry Signal populates, but I cannot figure out how to make that happen.
My Indicator Code for attached BarChart is as follows:
Var:
MP(0),//MP = marketposition
BuyCondition (False),
bool NakedBtm ( false ),
double NakedBtmLow ( 0 );

//reset flag
NakedBtm = false ;
NakedBtm = NakedBtm or Condition1 and MP=0;

//trigger bar detected, store values
if NakedBtm then
begin
NakedBtmLow = Low[1];
end;

//Naked Btm Condition
Condition1 = C[1]<L[2] and C>H[1];

//Filter Conditions
Condition2 = High > High[1];
Condition3 = Low > Low[1];
Condition4 = Low = Low[1];

//Buy Condition
BuyCondition = Condition1[1] and Condition2 and Condition3 or Condition4;

//Plots

//Long Entry
If BuyCondition then begin Plot2 (Low - .25, "LE", Red);
MP = 1;
End;

//Long Exit on Break of Trigger Bar bottom
If MP=1 and L < NakedBtmLow then begin Plot3(Low - .25, "LX", Green);
MP = 0;
END;

If MP=0 then Plot10 (HIGH + .75,"MP=0", blue);

If MP=1 then Plot11 (HIGH + .75,"MP=1", yellow);

As always, thank you sooo much for your expert guidance.

Attached Thumbnails
Future Reference to Past Bar-back-guru.bmp  
Reply With Quote
 
  #22 (permalink)
Trading Apprentice
Port St. Lucie, FL.
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES
 
Posts: 18 since May 2016
Thanks: 10 given, 7 received

One Last Glitch :(

Hello ABGT,

Sorry to bug you again but I have a glitch in my TradeStation ‘Naked Bottom” system which didn’t show-up right away. I have been working on a solution for over a week, and I finally run-out of ideas.

As discussed in our earlier correspondence; my ‘Naked Bottom” exit strategy (for a Long trade) is intended to trigger a Sell when price is < Entry Low [1]. In other words: Sell on a break of the low of the ‘Bar-Before-Entry’.

The code you helped me develop performs as intended except for one flaw.

As indicated on attached Barchart of my ‘Naked Bottom” system, the intended system sequence is as follows:
1. Market Position is MP=0 (Blue Dots on chart) until Entry Signal #1 is received.

2. Entry Signal #1 is received (Red Dot on chart) which initiates MP = 1 (Yellow Dots on chart) and signals a Long Trade.

3. Entry Signal #2 (Red Dot) is received and will continue with the original trade (Still MP = 1), but is expected to re-set the ‘Exit Trigger’ to < Entry Low [1] of Entry #2.

Note: In the case of Entry #2, the < Entry Low [1] of Entry #2 was not breached, and no exit was made (as was expected).

4. Entry Signal #3 (Red Dot) is received and continues the original trade (Still MP = 1), and (as discussed in Item 3 above) the ‘Exit Trigger’ is expected to be re-set to < Entry Low [1] of Entry #3.

Note: In the case of Entry #3, the < Entry Low [1] was breached, but no exit was made. Instead; many bars later, the actual exit (Green Dot) was made on the basis of < Entry Low [1] of Entry #1 (not Entry #3), whereupon Market Position was returned to MP=0 (Blue Dots on chart)

Question / Comment:
• How may I code my ‘Exit Trigger’ to re-calculate to the < Entry Low [1] for each succeeding Entry Signal, rather than the < Entry Low [1] of my initial entry?

Note: I do understand that a re-set depends on the Market Position reverting back to MP=0, when each new Entry Signal populates, but I cannot figure out how to make that happen.
My Indicator Code for attached BarChart is as follows:
Var:
MP(0),//MP = marketposition
BuyCondition (False),
bool NakedBtm ( false ),
double NakedBtmLow ( 0 );

//reset flag
NakedBtm = false ;
NakedBtm = NakedBtm or Condition1 and MP=0;

//trigger bar detected, store values
if NakedBtm then
begin
NakedBtmLow = Low[1];
end;

//Naked Btm Condition
Condition1 = C[1]<L[2] and C>H[1];

//Filter Conditions
Condition2 = High > High[1];
Condition3 = Low > Low[1];
Condition4 = Low = Low[1];

//Buy Condition
BuyCondition = Condition1[1] and Condition2 and Condition3 or Condition4;

//Plots

//Long Entry
If BuyCondition then begin Plot2 (Low - .25, "LE", Red);
MP = 1;
End;

//Long Exit on Break of Trigger Bar bottom
If MP=1 and L < NakedBtmLow then begin Plot3(Low - .25, "LX", Green);
MP = 0;
END;

If MP=0 then Plot10 (HIGH + .75,"MP=0", blue);

If MP=1 then Plot11 (HIGH + .75,"MP=1", yellow);

As always, thank you sooo much for your expert guidance.

Attached Thumbnails
Future Reference to Past Bar-back-guru.bmp  
Reply With Quote
 
  #23 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,403 since Apr 2013
Thanks: 219 given, 798 received
Forum Reputation: Legendary


Vientomarsol,

if I understand you correctly the problem you are facing spans from two things:

1. You need multiple different entries with each using its own stop value.
2. You only allow the stop value to be updated when you are flat.

You will most likely have to look into loops and arrays or use a list to accomplish what you want, be more convenient (although this would be a lot more complex due to the OOEL nature, though).

You basically need to update the NakedBtmLow every time the condition is met, but regardless of the market position. Then upon an entry signal store the current NakedBtmLow value in the list or array.
When you are currently in a position you have to loop through your list or array to check if the current price stopped any of your entries out, then you can remove this particular NakedBtmLow value from the list or array. This last part is where a list is more handy than the array for your problem, as removing entries is slightly simpler with lists (as you can simply shrink the list with removing entries, where the array would keep it's size and you'd manage the indices that have values within the array yourself).

This is definitely doable, but a bit more complex.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #24 (permalink)
Trading Apprentice
Port St. Lucie, FL.
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES
 
Posts: 18 since May 2016
Thanks: 10 given, 7 received

You're The Man !!

ABCTG,

Thanks (as always) for your prompt response.

I knew there must be a tool I was missing, and OOEL is apparently it.
Looks like I’ve got my work cut-out for me, but I can imagine that OOEL will be a useful tool for future projects.

Again, thanks.


Respectfully,

Vientomarsol

Reply With Quote
The following user says Thank You to Vientomarsol for this post:

Reply



futures io > > > > > Future Reference to Past Bar

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
Finding real price of current and past ADXVMA bar SolubleFish NinjaTrader Programming 10 May 20th, 2016 03:31 PM
reference last bar (of week) yeshe NinjaTrader Programming 2 October 21st, 2014 11:23 AM
Analyzing trades: Past vs Future Big Mike Psychology and Money Management 7 October 14th, 2012 04:54 PM
reference future data in EasyLanguage? shzhning EasyLanguage Programming 9 October 4th, 2012 10:28 AM
plot axis reference for bar style SARdynamite NinjaTrader Programming 1 July 17th, 2010 06:02 AM


All times are GMT -4. The time now is 08:53 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-22 in 0.11 seconds with 20 queries on phoenix via your IP 54.224.108.189