Programming Newbie - EasyLanguage Programming | futures io social day trading
futures io futures trading


Programming Newbie
Updated: Views / Replies:1,771 / 19
Created: by JGSmith Attachments:6

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

Programming Newbie

  #11 (permalink)
Elite Member
Duisburg, Germany
 
Futures Experience: Intermediate
Platform: TWS, NinjaTrader, MT4
Broker/Data: FXCM, Interactive Brokers, Oanda
Favorite Futures: Forex
 
Posts: 129 since Aug 2013
Thanks: 55 given, 44 received


ABCTG View Post
JGSmith,

you will need a flag for that. This is a variable you use to prevent the paintbar from plotting more than once.
The variable could be a Boolean variable i.e. true/false.

Something like this should work:

 
Code
Variables: HavePaintBar(false);

//the reset part:
if Close < KeltnerChannel and HavePaintBar then
HavePaintBar = false;

if __AroonUp = 100 and
Close > KeltnerChannel and
Open > Close and HavePaintBar = false then
begin
HavePaintBar = true;
PlotPaintBar(Open,Low,High,Close,"",Magenta);
end;
Regards,
ABCTG

Unfortunately, this didn't work. I will post some more details tomorrow to see if we can get this figured out. It may be something that plenty of people will find beneficial.

Reply With Quote
 
  #12 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

Okay. I just posted the idea from the top of my head and didn't test it first.
If you post the whole code, I can take a look at it tomorrow as well.

Regards and a good night,
ABCTG


JGSmith View Post
Unfortunately, this didn't work. I will post some more details tomorrow to see if we can get this figured out. It may be something that plenty of people will find beneficial.


Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #13 (permalink)
Trading for Profit
Houston, TX
 
Futures Experience: Intermediate
Platform: TradeStation
Broker/Data: TradeStation
Favorite Futures: CL
 
LogicalTrader's Avatar
 
Posts: 294 since Aug 2013
Thanks: 1,420 given, 752 received


In EasyLanguage, first occurrences of a condition being true or false can be derived by comparing the value of a variable set when the current bar is evaluated vs the value of the same variable set when the previous bar was evaluated.

For instance, if you store your condition (true/false) result in a variable "HavePaintBar" in your code - something like this:
 
Code
if (myCondition) then
HavePaintBar = True
Else
HavePaintBar = False;

Then to check if the condition became true for the first time, you could write something like this:
 
Code
If (HavePaintBar = True And HavePaintBar[1] = False) then
PlotPaintBar()...

The value evaluated for a variable for each previous bar can be accessed by using the [1], [2]... etc suffix as if the values are being stored in an array and you can access the value using the array index.

Hope this helps.

Reply With Quote
The following user says Thank You to LogicalTrader for this post:
 
  #14 (permalink)
Elite Member
Duisburg, Germany
 
Futures Experience: Intermediate
Platform: TWS, NinjaTrader, MT4
Broker/Data: FXCM, Interactive Brokers, Oanda
Favorite Futures: Forex
 
Posts: 129 since Aug 2013
Thanks: 55 given, 44 received


ABCTG View Post
Okay. I just posted the idea from the top of my head and didn't test it first.
If you post the whole code, I can take a look at it tomorrow as well.

Regards and a good night,
ABCTG

Great, thanks so much. Your help has been invaluable toward my further understanding.


iNeo View Post
In EasyLanguage, first occurrences of a condition being true or false can be derived by comparing the value of a variable set when the current bar is evaluated vs the value of the same variable set when the previous bar was evaluated.

For instance, if you store your condition (true/false) result in a variable "HavePaintBar" in your code - something like this:

Thank you iNeo. This has helped to move things forward. From what I can see, it is better - but still not exact.

I am posting a pic and the code for what I have so far.

Important for anybody reading this and may say, "Wow, that code produced a really great buy signal!!" and then attempt to use it. There is still one very important parameter that is not entered into the code yet so it is not tradeable as it is. Secondly, I haven't seen this strategy work as well on Futures or Equities. It may work, but I have not been able to find other instruments besides certain FX pairs that it works on.

In the picture, you will see some Blue squares. These blue squares are the ones that are correct - according to the current parameters. Those with the Red arrow above them are incorrect.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


 
Code
input:
	thold ( 20 ) ,
	length ( 14 ) ,
	CandleColorLong( white ) ,
	CandleColorShort( Magenta ), 
	AroonLength( 14 ),
	KCATR( 1.5 ) ,
	KCLength( 20 ),
	MALength( 20 ), 
	AFStep( 0.02 ),
	AfLimit( 0.2 );

variables:
	var0( 0 ) ,
	var1( 0 ) ,
	var2( 0 ) ,
	var3( 0 ) ,
	HavePaintBar( false ) ;
	
Value1 = ParabolicSAR( AfStep , AfLimit , var0 , var1 , var2 , var3 ) ;


	if __AroonUp( AroonLength ) = 100 and
		Close > Open and 
		Close > KeltnerChannel(close , KCLength , KCATR ) and
		Close > Average( Close , MALength ) and 
		var3 <= 1 and
		(__AroonUp[1]( AroonLength ) <> 100 or
		Close[1] < Open[1] or
		Close[1] < KeltnerChannel(close , KCLength , KCATR )[1] or
		Close[1] < Average( Close , MALength )[1] or
		var3 <= 1 ) 
	then
		HavePaintBar = True 
	else
		HavePaintBar = False;
		
	If HavePaintBar = True and 
		HavePaintBar[1] = False then 			
		PlotPaintBar(High , Low , Open , Close , "" , CandleColorLong ) ;
First, is there someway that I have misunderstood what has been said already and that is causing me to not get the result that I am looking for?
Secondly, if I have understood everything correctly thus far, can you see the adjustments that I need to make?

I genuinely want to thank people for their help. This has been invaluable to my learning up this point.

Reply With Quote
 
  #15 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

You are welcome.

Please check this code, I am using the close below the Keltner to reset the ability to look for a new paintbar.
If this doesn't do what you want, maybe you can post a screenshot that displays the bars this study shouldn't mark (just like you did with your study).

Regards,
ABCTG

 
Code
input:
	thold ( 20 ) ,
	length ( 14 ) ,
	CandleColorLong( white ) ,
	CandleColorShort( Magenta ), 
	AroonLength( 14 ),
	KCATR( 1.5 ) ,
	KCLength( 20 ),
	MALength( 20 ), 
	AFStep( 0.02 ),
	AfLimit( 0.2 );

variables:
	var0( 0 ) ,
	var1( 0 ) ,
	var2( 0 ) ,
	var3( 0 ) ,
	KeltnerValue(0),
	HavePaintBar( false ) ;
		
Value1 = ParabolicSAR( AfStep , AfLimit , var0 , var1 , var2 , var3 ) ;

KeltnerValue = KeltnerChannel(close , KCLength , KCATR );

//the reset part:
if Close < KeltnerValue and HavePaintBar then
HavePaintBar = false;

if __AroonUp( AroonLength ) = 100 and
	Close > Open and 
	Close > KeltnerValue and
	Close > Average( Close , MALength ) and 
	var3 <= 1 and
	(__AroonUp( AroonLength ) <> 100 or
	Close[1] < Open[1] or
	Close[1] < KeltnerValue[1] or
	Close[1] < Average( Close , MALength )[1] or
	var3 <= 1 ) 
then
	HavePaintBar = True;
	
If HavePaintBar = True and 
	HavePaintBar[1] = False then 			
	PlotPaintBar(High , Low , Open , Close , "" , CandleColorLong ) ;

Reply With Quote
 
  #16 (permalink)
Elite Member
Duisburg, Germany
 
Futures Experience: Intermediate
Platform: TWS, NinjaTrader, MT4
Broker/Data: FXCM, Interactive Brokers, Oanda
Favorite Futures: Forex
 
Posts: 129 since Aug 2013
Thanks: 55 given, 44 received


ABCTG View Post
Please check this code, I am using the close below the Keltner to reset the ability to look for a new paintbar.
If this doesn't do what you want, maybe you can post a screenshot that displays the bars this study shouldn't mark (just like you did with your study).

That works like a charm!

So it looks like you added another variable: KeltnerValue.

So basically if I wanted to do this with another indicator then I would need to add a new variable and then assign that variable with a value then I do that fancy little if/then statement and it all works?

Reply With Quote
 
  #17 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

Great. It didn't not work before, because in a previous post I just wrote "KeltnerChannel" without the inputs.
That's why it probably didn't compile on your end.

I just added the KeltnerValue variable so you don't have to call the same function three times in your code. Now it's only called one time and the value is assigned to the variable KeltnerValue.
You could do the same with the __AroonUp and the Average, as you call them twice, too.
With your study this isn't a problem, but every function call will add to the time the indicator takes for the calculations.
Your study will also become easier to maintain when all functions are called in one place and then stored within variables for further use (at least this is my experience).

Yes, it should work the same when you want to do it with another indicator.

Regards,
ABCTG


JGSmith View Post
That works like a charm!

So it looks like you added another variable: KeltnerValue.

So basically if I wanted to do this with another indicator then I would need to add a new variable and then assign that variable with a value then I do that fancy little if/then statement and it all works?


Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #18 (permalink)
Elite Member
Duisburg, Germany
 
Futures Experience: Intermediate
Platform: TWS, NinjaTrader, MT4
Broker/Data: FXCM, Interactive Brokers, Oanda
Favorite Futures: Forex
 
Posts: 129 since Aug 2013
Thanks: 55 given, 44 received

Phase 1 Complete

I just wanted to come on here and post a picture of the completed first phase of my very first indicator that I have written (with the exception of practice indicators while trying to learn)

This is the basis for a strategy that I trade very regularly and now I can just remove the indicators from my chart and have a nice clean and pretty screen.

After patting myself on the back for a little bit and reveling in this accomplishment - there will be plenty of more work to get the next phases completed.

Here is a picture of the work. (The arrows are not part of the indicator - they are just to make more obvious where the PaintBars are for the sake of this screenshot.)

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
 
  #19 (permalink)
Trading for Profit
Houston, TX
 
Futures Experience: Intermediate
Platform: TradeStation
Broker/Data: TradeStation
Favorite Futures: CL
 
LogicalTrader's Avatar
 
Posts: 294 since Aug 2013
Thanks: 1,420 given, 752 received

Good job.

Reply With Quote
 
  #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,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary


Looks good, congratulations. As you are using Multicharts you can in fact let the indicator draw the arrows on the chart, too.
Arw_New, Arw_New_s or Arw_New_DT are the three reserved words that can draw a new arrow. You can change size, color and style with keywords words, too.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Regards,
ABCTG


JGSmith View Post
I just wanted to come on here and post a picture of the completed first phase of my very first indicator that I have written (with the exception of practice indicators while trying to learn)

This is the basis for a strategy that I trade very regularly and now I can just remove the indicators from my chart and have a nice clean and pretty screen.

After patting myself on the back for a little bit and reveling in this accomplishment - there will be plenty of more work to get the next phases completed.

Here is a picture of the work. (The arrows are not part of the indicator - they are just to make more obvious where the PaintBars are for the sake of this screenshot.)

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


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

Reply



futures io > > > > > Programming Newbie

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
Visual Programming (programming without coding) LukeGeniol Platforms and Indicators 11 September 16th, 2016 01:49 PM
Newbie here sasquatch Beginners and Introductions 2 November 26th, 2012 12:43 PM
Newbie Help phyzfer Beginners and Introductions 7 June 23rd, 2010 04:05 AM


All times are GMT -4. The time now is 10:19 PM.

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-16 in 0.14 seconds with 20 queries on phoenix via your IP 54.227.51.103