Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 10-13-2011, 01:32 PM   #1

Join Date: Oct 2011
Posts: 7
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

EasyLanguage Help Needed

Hi all guys

I started studying EasyLanguage not long ago and I'm still a newbie.

I need a little help about a part of code of the TS I'm developing.

I want the TS to open a position at the "ConditionLong" signal, and, once the first position have been opened, I want it to open other positions of the same size and in the same direction every "X" points.

I tried to code it but the TS only opens the first position but not the others...
here is the code:

Code:
If marketposition = 0 and ConditionLong Then Buy next bar At High + 1 point stop;
If marketposition > 0 then buy next bar at entryprice + X points stop;
Thank you in advance for your help
LiukK is offline  
Reply With Quote
Old 10-13-2011, 10:53 PM   #2

Tradewinds's Avatar

Join Date: Nov 2008
Location: Northeast U.S.
Posts: 891
Ignore this user

Thanks: 373
Thanked 231 Times in 164 Posts
Blog Entries: 6

Re: EasyLanguage Help Needed

Quote:
Originally Posted by LiukK »
Hi all guys

I started studying EasyLanguage not long ago and I'm still a newbie.

I need a little help about a part of code of the TS I'm developing.

I want the TS to open a position at the "ConditionLong" signal, and, once the first position have been opened, I want it to open other positions of the same size and in the same direction every "X" points.

I tried to code it but the TS only opens the first position but not the others...
here is the code:

Code:
If marketposition = 0 and ConditionLong Then Buy next bar At High + 1 point stop;
If marketposition > 0 then buy next bar at entryprice + X points stop;
Thank you in advance for your help
Maybe if you tried something like this:

Code:
If marketposition = 0 and ConditionLong Then Buy next bar At High + 1 point stop;
If marketposition > 0 and Close >= entryprice + X then buy next bar at High points stop;
__________________
Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens.
Tradewinds is offline  
Reply With Quote
Old 10-14-2011, 07:59 AM   #3

Join Date: Oct 2011
Posts: 7
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: EasyLanguage Help Needed

Quote:
Originally Posted by Tradewinds »
Maybe if you tried something like this:

Code:
If marketposition = 0 and ConditionLong Then Buy next bar At High + 1 point stop;
If marketposition > 0 and Close >= entryprice + X then buy next bar at High points stop;
Hi Tradewinds and thank you for the answer!

however unfortunately it doesn't work because it opens just one position...

I try to explain pratically what I need:

once the first position is entered, say at 100, I want to pyramide it and buy other position every 20 points... so 100, 120, 140, 160...and so on...till the condition to close is met.
LiukK is offline  
Reply With Quote
Old 10-14-2011, 11:15 AM   #4

UrmaBlume's Avatar

Join Date: Apr 2008
Location: Las Vegas
Posts: 670
Ignore this user

Thanks: 87
Thanked 618 Times in 251 Posts

Re: EasyLanguage Help Needed

Market Position will only return 1, 0, or -1

CurrentShares will return how many you are long or short.

MarketPosition * CurrentShares will return true position with a + or - sign.
__________________
Information = Equity
UrmaBlume is offline  
Reply With Quote
Old 10-19-2011, 01:10 PM   #5

Join Date: Oct 2011
Posts: 7
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: EasyLanguage Help Needed

Quote:
Originally Posted by UrmaBlume »
Market Position will only return 1, 0, or -1

CurrentShares will return how many you are long or short.

MarketPosition * CurrentShares will return true position with a + or - sign.
Hi UrmaBlume and thank you for this detail!

However even changing the code I posted before this way:
Code:
If marketposition * CurrentShares = 0 and ConditionLong Then Buy next bar At High + 1 point stop;
If marketposition * CurrentShares > 0 and Close >= entryprice + X then buy next bar at High points stop;
the problem still persist.

I think I'd need something like a "lastentryprice" word in order to accomplish the code...

something like:
Code:
If marketposition = 0 and ConditionLong Then Buy next bar At High + 1 point stop;
If marketposition > 0 and Close >= lastentryprice + X then buy next bar at High points stop;
I'm sure there is something like this of which I'm not yet aware of

Anybody knows how to help me please?
LiukK is offline  
Reply With Quote
Old 10-20-2011, 01:22 AM   #6

Join Date: Jul 2010
Posts: 60
Ignore this user

Thanks: 13
Thanked 15 Times in 13 Posts

Re: EasyLanguage Help Needed

Hi LiuKK,

Have you checked the Pyramiding Check Box ? in the Format strategies--> Properties for All--> General--> Allow upto [ ] ???

Good Luck,
EasyTrader_I.
EasyTrader_I is offline  
Reply With Quote
The Following User Says Thank You to EasyTrader_I For This Useful Post:
Tradewinds (10-20-2011)
Old 10-20-2011, 05:07 AM   #7

Join Date: Oct 2011
Posts: 7
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: EasyLanguage Help Needed

Quote:
Originally Posted by EasyTrader_I »
Hi LiuKK,

Have you checked the Pyramiding Check Box ? in the Format strategies--> Properties for All--> General--> Allow upto [ ] ???

Good Luck,
EasyTrader_I.
Hi EasyTrader_I! and thank you for the answer.

Yes, that box is flagged...and still doesn't work.

I really can't understand what is wrong with this code...
LiukK is offline  
Reply With Quote
Old 10-20-2011, 01:53 PM   #8

Tradewinds's Avatar

Join Date: Nov 2008
Location: Northeast U.S.
Posts: 891
Ignore this user

Thanks: 373
Thanked 231 Times in 164 Posts
Blog Entries: 6

Re: EasyLanguage Help Needed

Quote:
Originally Posted by LiukK »

I think I'd need something like a "lastentryprice" word in order to accomplish the code...

something like:
Code:
If marketposition = 0 and ConditionLong Then Buy next bar At High + 1 point stop;
If marketposition > 0 and Close >= lastentryprice + X then buy next bar at High points stop;
This is from the Easy Language help:

Quote:
Returns the entry price for the specified position.

EntryPrice(Num)

Where Num is a numeric expression representing the number of positions ago (up to a maximum of ten).

Remarks
This function can only be used in the evaluation of strategies. It does not require an input, however, by using the input Num, you can obtain the specified value from a previous position, up to ten positions ago.

Example
EntryPrice(2) might return a value of 101.19 as the entry price of 2 positions ago on a chart of Microsoft stock.
Are you entering a number for how many entry orders back the entry was? You need to use the syntax:

EntryPrice(1)
__________________
Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens.
Tradewinds is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
What else is Needed to Get It Right? bharatk8 Tools of the Trade 0 04-10-2011 06:55 PM
EL Help Needed swakpixel Coding Forum 6 05-01-2010 06:28 AM
Jurik Easylanguage Functions Needed simterann22 Coding Forum 2 08-20-2009 12:01 PM
just what i needed xztheericzx Beginners Forum 0 11-04-2007 05:21 AM

All times are GMT -4. The time now is 11:04 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.