entryprice(0)

Questions about MultiCharts and user contributed studies.
flipflopper
Posts: 261
Joined: 28 Feb 2008
Has thanked: 2 times
Been thanked: 1 time

entryprice(0)

Postby flipflopper » 22 Jan 2010

Why doesn't this work? I could never get the entryprice keyword to work.

If marketposition = 1 then
sell("My Long Exit") entry("My Long") entryprice(0) - 2 stop;

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 24 Jan 2010

You should not need an argument in this case. Try simply using "sell ("LX") next bar at EntryPrice - 2 stop" and if that works, you can reintroduce your "from entry" restriction - perhaps you've made a mistake in that part.

flipflopper
Posts: 261
Joined: 28 Feb 2008
Has thanked: 2 times
Been thanked: 1 time

Postby flipflopper » 24 Jan 2010

When I use the following:

If marketposition = 1 then
sell("My Long Exit") entry("My Long") (entryprice - 2) stop;

It just sells at teh next bar every time regardless. I'm pretty sure entryprice keyword doesn't work.

geektrader
Posts: 100
Joined: 17 Jul 2009
Location: Germany

Postby geektrader » 24 Jan 2010

You are doing this a bit wrong, entryprice - 2 would, just as an example, for Forex mean

Entryprice (let´s say 1.5242) - 2 = you want to sell when the price is at at -0.5. Which makes no sense.

You need to use

Entryprice - 2 points

So your formula would look like:

If marketposition = 1 then
sell("My Long Exit") entry("My Long") (entryprice - 2 points) stop;

flipflopper
Posts: 261
Joined: 28 Feb 2008
Has thanked: 2 times
Been thanked: 1 time

Postby flipflopper » 25 Jan 2010

This is designed for the ES. I added the key word points just to try and got the same result.

I strongly believe that the entryprice keyword does not work in Multicharts.

Unfortunately the way I test what certain variables are showing is buy creating an indicator with the same code and leaving out the buy/sell orders and ploting what I am looking at. Can't be done for strategy specific keywords though.

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 25 Jan 2010

In a study, you can use the keyword i_AvgEntryPrice instead.

geektrader
Posts: 100
Joined: 17 Jul 2009
Location: Germany

Postby geektrader » 25 Jan 2010

Well, I can only say that "entryprice" always works fine for me as my exit strategies are also based on it solely.That is for automated EUR/USD trading though.

You can do this, let the system open a trade and add a

print (entryprice);

Then look at the output and see if it prints the correct entryprice.

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 25 Jan 2010

I agree it's more likely this is a misunderstanding unless the bug is obscure - try removing the "from entry" restriction, and printing entryprice to the debug log is a good idea for getting an understanding of what its value is as the trade progresses.


Return to “MultiCharts”