indiTraders - Forum for the Active Indian Trader  

Go Back   indiTraders - Forum for the Active Indian Trader > Tools > Software > Tradestation

FXPrimus
Reply
 
Bookmark and Share LinkBack (1) Thread Tools Display Modes
  #21 (permalink)  
Old 13-02-2010, 12:58 AM
rajatheroyal's Avatar
rajatheroyal rajatheroyal is offline
indiTraders VIP
 
Join Date: Mar 2009
Posts: 819
Thanks: 1,518
Thanked 1,627 Times in 628 Posts
rajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to behold
Default

with that post completed my 150 post.
__________________
Those who know,Don't Talk.Those who Talk,Don't Know.

Last edited by rajatheroyal; 13-02-2010 at 01:02 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 6 Users Say Thank You to rajatheroyal For This Useful Post:
  #22 (permalink)  
Old 14-02-2010, 01:01 PM
alex alex is offline
indiTraders VIP
 
Join Date: Mar 2009
Location: Mumbai
Posts: 4,928
Thanks: 14,926
Thanked 13,315 Times in 4,262 Posts
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
Default

Originally Posted by rajatheroyal View Post
Yes practically we dont use For loops much, because instead we use a function for that purpose which uses For loop.
For example you might have used Average fuction.Actually it uses For loop to calculate it,but since most of the stuff we use is readily available in easy use functions we dont feel much need of using loops.But For loops might be useful to those people who create their own functions.

For example

say if you need to calculate the sum of last 5 bars close what do you do?

Yes its easy...........you will simply put c[1]+c[2]+c[3]+c[4]+c[5]

sounds easy.........

but what if say you need to calculate the sum of close of last 100 bars?

Its not practial to put c[1]+...............c[100]

Actually there is a function for that "summation" but if you did not have that we have to do using For loops.

{Here is a way to do it using For loops}
//-------------------------------------------------------------------------------------------------------------
vars: sumofclose(0);

for value1=1 to 100

begin

sumofclose=sumofclose+close[value1];

end;

print(sumofclose);
//----------------------------------------------------------------------------------------------------------

thanks a lot, i have got zero marks in my first exam on EL will work hard for sure
__________________
The essence of mathematics is not to make simple things complicated, but to make complicated things simple.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 5 Users Say Thank You to alex For This Useful Post:
  #23 (permalink)  
Old 14-02-2010, 01:03 PM
alex alex is offline
indiTraders VIP
 
Join Date: Mar 2009
Location: Mumbai
Posts: 4,928
Thanks: 14,926
Thanked 13,315 Times in 4,262 Posts
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
Default

here is more on 'for' and use of 'loop'
Attached Files
File Type: pdf Some Programming Issues in Easy Language.pdf (71.0 KB, 66 views)
__________________
The essence of mathematics is not to make simple things complicated, but to make complicated things simple.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 9 Users Say Thank You to alex For This Useful Post:
  #24 (permalink)  
Old 14-02-2010, 03:38 PM
Oxymoron's Avatar
Oxymoron Oxymoron is offline
Super Moderator
 
Join Date: Mar 2009
Location: Chennai
Posts: 1,275
Thanks: 4,471
Thanked 4,830 Times in 1,156 Posts
Oxymoron has a reputation beyond repute
Oxymoron has a reputation beyond reputeOxymoron has a reputation beyond reputeOxymoron has a reputation beyond reputeOxymoron has a reputation beyond reputeOxymoron has a reputation beyond reputeOxymoron has a reputation beyond reputeOxymoron has a reputation beyond reputeOxymoron has a reputation beyond reputeOxymoron has a reputation beyond reputeOxymoron has a reputation beyond reputeOxymoron has a reputation beyond reputeOxymoron has a reputation beyond repute
Default

Originally Posted by alex View Post
here is more on 'for' and use of 'loop'

This is excellent stuff. Thanks a lot, Alex!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 3 Users Say Thank You to Oxymoron For This Useful Post:
  #25 (permalink)  
Old 14-02-2010, 06:11 PM
rajatheroyal's Avatar
rajatheroyal rajatheroyal is offline
indiTraders VIP
 
Join Date: Mar 2009
Posts: 819
Thanks: 1,518
Thanked 1,627 Times in 628 Posts
rajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to beholdrajatheroyal is a splendid one to behold
Default

Originally Posted by alex View Post
here is more on 'for' and use of 'loop'

Really excellent .....where do you guys get these stuff
__________________
Those who know,Don't Talk.Those who Talk,Don't Know.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 4 Users Say Thank You to rajatheroyal For This Useful Post:
  #26 (permalink)  
Old 14-02-2010, 09:15 PM
Santosh Santosh is offline
.
 
Join Date: Nov 2009
Posts: 731
Thanks: 16,567
Thanked 2,160 Times in 683 Posts
Santosh has much to be proud ofSantosh has much to be proud ofSantosh has much to be proud ofSantosh has much to be proud ofSantosh has much to be proud ofSantosh has much to be proud ofSantosh has much to be proud ofSantosh has much to be proud ofSantosh has much to be proud ofSantosh has much to be proud ofSantosh has much to be proud ofSantosh has much to be proud of
Default

Originally Posted by alex View Post
here is more on 'for' and use of 'loop'

Very Good One... Especially for a beginner like me...

Good One Alex

Please keep updating more like this if any
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 5 Users Say Thank You to Santosh For This Useful Post:
  #27 (permalink)  
Old 15-02-2010, 11:19 AM
devdas's Avatar
devdas devdas is offline
edevaay.com
 
Join Date: Mar 2009
Location: Tactical Hell....
Posts: 5,472
Thanks: 15,941
Thanked 18,572 Times in 5,164 Posts
devdas has a reputation beyond reputedevdas has a reputation beyond reputedevdas has a reputation beyond reputedevdas has a reputation beyond repute
devdas has a reputation beyond reputedevdas has a reputation beyond reputedevdas has a reputation beyond reputedevdas has a reputation beyond reputedevdas has a reputation beyond reputedevdas has a reputation beyond reputedevdas has a reputation beyond reputedevdas has a reputation beyond reputedevdas has a reputation beyond reputedevdas has a reputation beyond reputedevdas has a reputation beyond repute
Default

Cake Walk....

:elephantride: :gamer:
__________________
Harvest The Moon !!
Nest The Market !!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 2 Users Say Thank You to devdas For This Useful Post:
  #28 (permalink)  
Old 15-02-2010, 07:03 PM
Saurabh's Avatar
Saurabh Saurabh is offline
♫ Unconfined ♫
 
Join Date: Mar 2009
Location: Indiaaah!
Posts: 618
Thanks: 1,200
Thanked 2,051 Times in 549 Posts
Saurabh has disabled reputation
Default

Here is a code for drawing Support which uses the 'for' loop.

suggest a better way to code it... can't even use swinglow properly, not to talk about adding swinghigh...
Code:
Type: Function, Name: Support
Inputs:
Strength(Numeric),
Length(Numeric);
Vars:
SCalc(0);

Array: Supp[100](0);
Condition1 = SwingLow(1, Low, Strength, Strength+1) <> -1;
IF Condition1 Then Begin
For value1 = 100 DownTo 2 Begin
Supp[value1] = Supp[value1-1];
End;
Supp[1] = Low[Strength];
End;
IF Supp[Length] <> 0 Then Begin
SCalc = 0;
For value1 = 1 To Length Begin
SCalc = SCalc + IntPortion(Supp[value1] / Close);
End;
Support = 100 * (1 - (SCalc / Length));
End Else
Support = 0;
Code:
Type: Indicator, Name: dummy
 Inputs: Strength(4), Length(6); 
 Plot1(Support(Strength, Length), "SupportOsc");
__________________
Asatoma Sat Gamaya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 2 Users Say Thank You to Saurabh For This Useful Post:
  #29 (permalink)  
Old 15-02-2010, 07:20 PM
Darshiit's Avatar
Darshiit Darshiit is offline
indiTraders VIP
 
Join Date: Mar 2009
Posts: 978
Thanks: 9,155
Thanked 7,250 Times in 1,873 Posts
Darshiit has a reputation beyond reputeDarshiit has a reputation beyond repute
Darshiit has a reputation beyond reputeDarshiit has a reputation beyond reputeDarshiit has a reputation beyond reputeDarshiit has a reputation beyond reputeDarshiit has a reputation beyond reputeDarshiit has a reputation beyond reputeDarshiit has a reputation beyond reputeDarshiit has a reputation beyond reputeDarshiit has a reputation beyond reputeDarshiit has a reputation beyond reputeDarshiit has a reputation beyond repute
Default

Originally Posted by Saurabh View Post
Here is a code for drawing Support which uses the 'for' loop.

suggest a better way to code it... can't even use swinglow properly, not to talk about adding swinghigh...
Code:
Type: Function, Name: Support
Inputs:
Strength(Numeric),
Length(Numeric);
Vars:
SCalc(0);

Array: Supp[100](0);
Condition1 = SwingLow(1, Low, Strength, Strength+1) <> -1;
IF Condition1 Then Begin
For value1 = 100 DownTo 2 Begin
Supp[value1] = Supp[value1-1];
End;
Supp[1] = Low[Strength];
End;
IF Supp[Length] <> 0 Then Begin
SCalc = 0;
For value1 = 1 To Length Begin
SCalc = SCalc + IntPortion(Supp[value1] / Close);
End;
Support = 100 * (1 - (SCalc / Length));
End Else
Support = 0;
Code:
Type: Indicator, Name: dummy
 Inputs: Strength(4), Length(6); 
 Plot1(Support(Strength, Length), "SupportOsc");

This one worked fine here .
What u exactly want to do with it Saurabh. Its actually an Oscillator.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 4 Users Say Thank You to Darshiit For This Useful Post:
  #30 (permalink)  
Old 15-02-2010, 07:26 PM
Saurabh's Avatar
Saurabh Saurabh is offline
♫ Unconfined ♫
 
Join Date: Mar 2009
Location: Indiaaah!
Posts: 618
Thanks: 1,200
Thanked 2,051 Times in 549 Posts
Saurabh has disabled reputation
Default

goal: to draw a support line like I do from my chart reading
First step: the oscillator should reflect the price of major swinglows
Attached Images
File Type: png untitled.PNG (28.5 KB, 39 views)
__________________
Asatoma Sat Gamaya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 3 Users Say Thank You to Saurabh For This Useful Post:
Reply

indiTraders - Forum for the Active Indian Trader > Tools > Software > Tradestation


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://www.inditraders.com/tradestation/2530-easylanguage-coding.html
Posted By For Type Date
Source This thread Refback 09-02-2011 01:38 AM

FXPrimus

All times are GMT +5.5. The time now is 08:38 PM.


vBulletin Copyright by vBulletin

Content Relevant URLs by vBSEO 3.3.2