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


Programming Newbie
Updated: Views / Replies:1,766 / 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

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

Programming Newbie

So I have finally decided to try my hand at EasyLanguage / PowerLanguage.

Sometime I will get around to doing one of the courses on it, but for now I am just doing some self-teaching.

I have run into a strange issue. I am trying to create a PaintBar that will change color if the price is above the PSAR vs below the PSAR.

Here is the code of what I have and maybe somebody could help me out with what I am doing wrong.

Variables:
var0( 0 ) ,
var1( 0 ) ,
var2( 0 ) ,
var3( 0 ) ;



if Close > ParabolicSAR( .02 , .2 , var0 , var1 , var2 , var3 ) then begin
PlotPaintBar( High , Low , Open , Close , "" , White ) ;
end

If Close < ParabolicSAR( .02 , .2 , var0 , var1 , var2 , var3 ) then begin
PlotPaintBar(High , Low , Open , Close "" , White ) ;
end

First of all, this will not compile. It says that it does not expect the second "if" statement. Therefore, my first question is what is wrong with this keeping it from accepting the second If statement.

The second issue is that, if I take out the second If statement, then it has no problems compiling - but, it colors every single bar as white. What have I done wrong so that every bar is white rather than only the bars that are above the PSAR.

If I take out the first If statement and only choose to color the bars that are below the PSAR then none of the bars will color.

If you need it, here is the ParabolicSAR function code:

inputs: AfStep( 0.02), AfLimit( 0.2 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ), var3( 0 ), var4( "" ) ;

Value1 = ParabolicSAR( AfStep , AfLimit , var0 , var1 , var2 , var3 ) ;

Plot1( var0, "ParCl" ) ;


if var3 = 1 then
Alert( "Bullish reversal" )
else if var3 = -1 then
Alert( "Bearish reversal" ) ;


Thank you very much for your help.

There are a few items that I have that will come after this.

Reply With Quote
The following user says Thank You to JGSmith for this post:
 
  #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
Cleveland Ohio/United States
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: various
Favorite Futures: futures
 
Posts: 2,388 since Jul 2012
Thanks: 1,138 given, 4,387 received
Forum Reputation: Legendary



JGSmith View Post
So I have finally decided to try my hand at EasyLanguage / PowerLanguage.

Sometime I will get around to doing one of the courses on it, but for now I am just doing some self-teaching.

I have run into a strange issue. I am trying to create a PaintBar that will change color if the price is above the PSAR vs below the PSAR.

Here is the code of what I have and maybe somebody could help me out with what I am doing wrong.

Variables:
var0( 0 ) ,
var1( 0 ) ,
var2( 0 ) ,
var3( 0 ) ;



if Close > ParabolicSAR( .02 , .2 , var0 , var1 , var2 , var3 ) then begin
PlotPaintBar( High , Low , Open , Close , "" , White ) ;
end

If Close < ParabolicSAR( .02 , .2 , var0 , var1 , var2 , var3 ) then begin
PlotPaintBar(High , Low , Open , Close "" , White ) ;
end

First of all, this will not compile. It says that it does not expect the second "if" statement. Therefore, my first question is what is wrong with this keeping it from accepting the second If statement.

The second issue is that, if I take out the second If statement, then it has no problems compiling - but, it colors every single bar as white. What have I done wrong so that every bar is white rather than only the bars that are above the PSAR.

If I take out the first If statement and only choose to color the bars that are below the PSAR then none of the bars will color.

If you need it, here is the ParabolicSAR function code:

inputs: AfStep( 0.02), AfLimit( 0.2 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ), var3( 0 ), var4( "" ) ;

Value1 = ParabolicSAR( AfStep , AfLimit , var0 , var1 , var2 , var3 ) ;

Plot1( var0, "ParCl" ) ;


if var3 = 1 then
Alert( "Bullish reversal" )
else if var3 = -1 then
Alert( "Bearish reversal" ) ;


Thank you very much for your help.

There are a few items that I have that will come after this.


1. Put a semicolon after every "end" statement (

2. You have both conditions painting the bar as white. Also, make sure ParabolicSAR is giving you correct values.



You don't need a course to learn Easy Language. Try these 2 guides. They are old, but if you follow the exercises, you'll get up to speed quickly, and for free.

If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
Attached Thumbnails
Programming Newbie-el_essentials.pdf   Programming Newbie-el_functionsandreservedwords_ref.pdf  
Reply With Quote
 
  #4 (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


kevinkdog View Post
1. Put a semicolon after every "end" statement (

2. You have both conditions painting the bar as white. Also, make sure ParabolicSAR is giving you correct values.



You don't need a course to learn Easy Language. Try these 2 guides. They are old, but if you follow the exercises, you'll get up to speed quickly, and for free.

haha, pretty dumb mistake about both conditions being white. LOL. Obviously I was working on that late last night.

Anyway, I will post the updated code. It has not changed anything so I think that it has to do with the PSAR giving the correct values. I will also post a pic of the chart. As far as I know, in the PSAR code, the only values that matter are the .02 & .2. Correct? From what I understand in the EasyLanguage dictionary that the other values are just for order entry/management.

Also, thanks a ton for the resources to learn EL. I will spend time on those.

Variables:
var0( 0 ) ,
var1( 0 ) ,
var2( 0 ) ,
var3( 0 ) ;



if Close > ParabolicSAR( .02 , .2 , var0 , var1 , var2 , var3 ) then begin
PlotPaintBar( High , Low , Open , Close , "" , White ) ;
end ;

If Close < ParabolicSAR( .02 , .2 , var0 , var1 , var2 , var3 ) then begin
PlotPaintBar(High , Low , Open , Close , "" , Magenta ) ;
end ;


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

Reply With Quote
 
  #5 (permalink)
Market Wizard
Cleveland Ohio/United States
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: various
Favorite Futures: futures
 
Posts: 2,388 since Jul 2012
Thanks: 1,138 given, 4,387 received
Forum Reputation: Legendary

You are using the function incorrectly. Below is info from the Help file:

Returns (Integer)
The oParCl, OParOP, oPosition, oTransition output parameters return the parabolic stop values for the current day and the next bar, as well as the probable position of the market. The ParabolicSAR itself returns 1.

Parameters
Name
Type
Description

AfStep
Numeric
Sets the acceleration increment factor.

AfLimit
Numeric
Sets the acceleration limitation factor.

oParCl
Numeric
Outputs the parabolic stop value for the current bar.

oParOp
Numeric
Outputs the parabolic stop value for the next bar.

oPosition
Numeric
Outputs the potential market position. 1 for long, -1 for short.

oTransition
Numeric
Outputs if the current bar market position has changed. 1 or -1 for reversal days 0 for holding days.



Example
Vars: oParCl(0), oParOp(0), oPostion(0), oTransition(0);

Value1 = ParabolicSAR(0.02, 0.4, oParCl, oParOp, oPosition, oTransition);
Value2 = oParCl;
Value3 = oParOp;
Value4 = oPosition;
Value5 = oTransition;


If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
Reply With Quote
 
  #6 (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


kevinkdog View Post
You are using the function incorrectly. Below is info from the Help file:

Okay thanks.

Obviously there is still plenty more for me to learn as this information doesn't help me much.

I am actively going through the PDFs that you posted and will see if that information helps me.

Reply With Quote
 
  #7 (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

Finally got that figured out. Now it works like a charm!

Here is my next question and I can not find the answer to this anywhere in any of the easy language docs.

This one also deals with PaintBars.

Now I would like to create a paint bar if the Aroon Up indicator = 100, Close > Open, and Close > keltner Channel. But, I only want it on the first candle that closes outside of the keltner channel. Basically it needs to close back inside of the keltner channel in order to "reset".

 
Code
if __AroonUp = 100 and
Close > KeltnerChannel and
Open > Close then
PlotPaintBar(Open,Low,High,Close,"",Magenta);
Clearly that part is quite straight forward.

But now I need to figure out how to just make the first occurrence of the close outside of the KeltnerChannel to the painted bar.

Any suggestions?

I really appreciate the help.

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

JGSmith,

you can also google for EasyLanguage or PowerLanguage tutorials. There are some around that might help you, too.
Other than that you are already moving into the right direction. You best learn the language when you program it. Start simple and keep getting more complex. If you run into a problem there is always a helping hand here.

Regards,
ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #9 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,527 since Apr 2013
Thanks: 229 given, 854 received
Forum Reputation: Legendary

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


JGSmith View Post
Finally got that figured out. Now it works like a charm!

Here is my next question and I can not find the answer to this anywhere in any of the easy language docs.

This one also deals with PaintBars.

Now I would like to create a paint bar if the Aroon Up indicator = 100, Close > Open, and Close > keltner Channel. But, I only want it on the first candle that closes outside of the keltner channel. Basically it needs to close back inside of the keltner channel in order to "reset".

 
Code
if __AroonUp = 100 and
Close > KeltnerChannel and
Open > Close then
PlotPaintBar(Open,Low,High,Close,"",Magenta);
Clearly that part is quite straight forward.

But now I need to figure out how to just make the first occurrence of the close outside of the KeltnerChannel to the painted bar.

Any suggestions?

I really appreciate the help.


Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #10 (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 can also google for EasyLanguage or PowerLanguage tutorials. There are some around that might help you, too.
Other than that you are already moving into the right direction. You best learn the language when you program it. Start simple and keep getting more complex. If you run into a problem there is always a helping hand here.

Regards,
ABCTG

Thanks a ton, ABCTG

Looks like we are practically neighbors. You are in Hamburg. I am often there as my wife's family is in Lübeck. Would be fun to meet up sometime.

Reply With Quote

Reply



futures io > > > > > Programming Newbie

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

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 11:35 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-12 in 0.15 seconds with 20 queries on phoenix via your IP 54.234.255.29