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,329 / 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

  #11 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,465 since Apr 2013
Thanks: 224 given, 835 received

Vientomarsol,

I am afraid your code wouldn't compile (as it contains pseudo code) and to properly debug it one would most likely need a working version (where you could exchange the proprietary parts to something open source, as long as same the problems stay apparent).

You might want to print the values your code generates and check what values were used exactly at the bars that "appear" problematic".

You wrote "In at least one case, an exit was made on a subsequent trigger Bar Low.". If I understand you correctly this is exactly what I meant here. Did you try the suggestion I gave you to avoid that?

Regards,

ABCTG

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

Please hang with Me - I don't want to lose Your Help !

Hello ABCTG,

I was afraid my pseudo code might 'queer the deal'. My Values 1 and 2 are purchased indicators that contain a password in the values themselves, so I can't post them on a public forum.

I have an idea. Let me rewrite my code using Larry Williams' famous "Naked Bottom' as my trigger bar. Larry has been gracious enough to release this indicator to the public, so I can upload his code without fear. (and give him a plug).

I'll run the Naked Bottom Trigger System (and use your code to store the values) and see what I get. I'll post the results this afternoon.

I'm hoping you will be kind enough take a look at those results, and provide specific comments and suggestions..

Again, thanks sooo much for hanging with me, and trying to 'show me the way'. I'll have the updated results up by EOD today.

Respectfully,

Reply With Quote
 
  #13 (permalink)
Trading Apprentice
Port St. Lucie, FL.
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES
 
Posts: 22 since May 2016
Thanks: 14 given, 7 received

Almost Have it !!!


Greetings ABCTG,

I’m happy to report that I've updated my code to use Larry Williams’ “NAKED BOTTOM” indicator as my Trigger Bar, and with one [hopefully] minor exception, it works!!!

Here is the code:
Var:
MP(0),//MP = marketposition
bool isTriggerBar ( false ),
double triggerBarHigh ( 0 ),
double triggerBarLow ( 0 );

//reset flag
isTriggerBar = false ;

isTriggerBar = isTriggerBar or Condition1;

//trigger bar detected, store values
if isTriggerBar then
begin
triggerBarHigh = High[1] ;
triggerBarLow = 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];

//Plots
//Naked Btm TriggerBar
If Condition1 then Plot1(Low - .25, "Nkd_Btm", red);

//Long Entry
If Condition1[1] {previous bar = Naked Btm} and Condition2 {this bar = Higher High than Naked Btm}
and (Condition3 or condition4) {this bar = Low =/> Naked Btm} then begin Plot2 (Low - .25, "LE", White);
MP = 1;
End;

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

WHAT IS WORKING:

When using “NAKED BOTTOM” as Condition1, the following sequence is expected:

A. Long entry (MP=1) is initiated via:
o Condition1[1] and Condition2 and (Condition3 or condition4)

And then:

B. An exit is initiated via:
o MP=1 and L < Condition1

The above code works flawlessly in all cases but one. The exception is as follows:

WHAT IS NOT WORKING:


C. Long entry (MP=1) is initiated via:
o Condition1[1] and Condition2 and (Condition3 or condition4)

And then:

D. A second Condition1 (Trigger Bar) plots without conditions 2, 3, or 4 and no entry is initiated

And then:

E. An exit is initiated on < Low of item D (above) rather than item B (above).

Examples of Item D exits are circled on attached screen-prints.

QUESTIONS:

1. Do why know why I'm exiting on < Low of item D (above) rather than item B (above)?

2. Do you know how to revise my code so this will not happen?


As always, I'm mucho appreciative of your help.

You're a very smart guy, and have shown me EL functions which I did not know were possible.

Again, Thanks!!

Attached Thumbnails
Future Reference to Past Bar-bitmap-1.bmp   Future Reference to Past Bar-bitmap-2.bmp   Future Reference to Past Bar-bitmap-3.bmp   Future Reference to Past Bar-bitmap-4.bmp  
Reply With Quote
 
  #14 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,465 since Apr 2013
Thanks: 224 given, 835 received

Vientomarsol,

EasyLanguage code is evaluated from top to bottom (unless you use methods, which you don't). If you use a variable or condition before you evaluate it in your code, you will use the previous bar's (or code execution's) value for it.

I would strongly suggest to use the Print command or the plot reserved words in your debugging, to actually see what values a variable in your code holds at the very moment, when it gets updated etc..

Regards,

ABCTG

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

Where did you learn all this stuff??

ABCTG,

I don't know how to use the Print command, or the plot reserved words in your debugging, but I'll figure it out and post my results.

Thanks again for your prompt reply.

Reply With Quote
 
  #16 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,465 since Apr 2013
Thanks: 224 given, 835 received

Vientomarsol,

you are already using "Plot" in your code. Plots are a great way to visualize what is going on in your code when trying to track problems down.

Look the "print" reserved word up in the editor's help - for example by writing print in your code, highlighting it and pressing F1. This will bring up the online help and give you ideas on how to use it. With that you can print values at certain times or continuously to the output log - this is a great way to keep track on what is going on in your code.

Regards,

ABCTG




Vientomarsol View Post
ABCTG,

I don't know how to use the Print command, or the plot reserved words in your debugging, but I'll figure it out and post my results.

Thanks again for your prompt reply.


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

Response to ABCTG

ABCTG,

Yes, I have figured out how to use the plot function to verify my code prior to exporting to a strategy, but I'm not familiar with the print (Parameter) function.

I just read the Tradestation EL description of 'Print (Parameter)' function, and (to me anyway) it may as well be written in Chinese.

Could you give me an example of how this function would be coded to print the sequence of my code (or part of the code)?

Thanks

Reply With Quote
 
  #18 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,465 since Apr 2013
Thanks: 224 given, 835 received

Vientomarsol,

the examples Tradestation provides in their help (at least for the print) are quite good actually and cover everything you need to know. In your case I'd start with checking what values are stored for the trigger bar and more important when they are stored.

 
Code
//trigger bar detected, store values
if isTriggerBar then
begin
triggerBarHigh = High[1] ;
triggerBarLow = Low[1] ;
Print( ElDateToString( Date ), "; Time: ", Time:0:0, "; triggerBarHigh: ", triggerBarHigh, "; triggerBarLow: ", triggerBarLow ) ;
end ;
The print statement will go to Tradestation's Print Log tab in the main window. If you don't see it, you will have to enable it under -> View -> EasyLanguage Print Log.

This, together with using Plots to display values on the chart, should give you a good start to find out yourself what is going on in your code.

Regards,

ABCTG


Vientomarsol View Post
ABCTG,

Yes, I have figured out how to use the plot function to verify my code prior to exporting to a strategy, but I'm not familiar with the print (Parameter) function.

I just read the Tradestation EL description of 'Print (Parameter)' function, and (to me anyway) it may as well be written in Chinese.

Could you give me an example of how this function would be coded to print the sequence of my code (or part of the code)?

Thanks


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

Got it Running !!!

ABCTG,

You code was exactly what I needed. I plugged it in, and it is outputting to my PrintLog as I write this.
I'll keep an eye on the print output today, and see if I can define my glitch.



I'm humbled by your generosity.
Again, thanks so much. I'll report back on my findings.

Reply With Quote
The following 2 users say Thank You to Vientomarsol for this post:
 
  #20 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,465 since Apr 2013
Thanks: 224 given, 835 received


Vientomarsol,

you are welcome and thank you for your kind words.

Regards,

ABCTG

Reply With Quote
The following 2 users say Thank You to ABCTG 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)
 

RandBots: AutoTrading Bots to diversify your trading

Oct 24
 

TopstepTrader: Profiting Without Risking Your Own Money

Oct 26

Building Open Source Indicators for NT8 w/Fat Tails @ Lizard Indicators

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 02:44 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-10-20 in 0.13 seconds with 20 queries on phoenix via your IP 54.166.245.10