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

Reply
Old 02-26-2009, 04:34 PM   #1

Join Date: Feb 2008
Location: Oslo
Posts: 9
Ignore this user

Thanks: 2
Thanked 1 Time in 1 Post

Turning a Buy into a SellShort (PowerLanguage)

Trying to get my feet wet with MultiCharts, without any prior EasyLanguage experience. Looks good so far, but one thing I've done is to work out a strategy the "wrong way around" - getting it to perform as badly as possible, and I'm now trying to reverse the signals:

This is the long entry (it's your classic Price Channel Breakout) that's working, a buy stop:

Input: Price (High), Length(20);
Buy ("Long") next bar at HighestFC (Price,Length) + 1 point stop;

Now I want to make this into a sell if price breaches the H(20), here's my take which gives the wrong entry price:

SellShort ("Short") next bar at HighestFC (Price, Length) +1 point stop;

Anyone care to lend a newbie a hand here?
hrokling is offline  
Reply With Quote
Old 02-27-2009, 01:38 AM   #2

Join Date: Nov 2006
Location: N/A
Posts: 612
Ignore this user

Thanks: 62
Thanked 294 Times in 177 Posts

Re: Turning a Buy into a SellShort (PowerLanguage)

Quote:
Originally Posted by hrokling »
Trying to get my feet wet with MultiCharts, without any prior EasyLanguage experience. Looks good so far, but one thing I've done is to work out a strategy the "wrong way around" - getting it to perform as badly as possible, and I'm now trying to reverse the signals:

This is the long entry (it's your classic Price Channel Breakout) that's working, a buy stop:

Input: Price (High), Length(20);
Buy ("Long") next bar at HighestFC (Price,Length) + 1 point stop;

Now I want to make this into a sell if price breaches the H(20), here's my take which gives the wrong entry price:

SellShort ("Short") next bar at HighestFC (Price, Length) +1 point stop;

Anyone care to lend a newbie a hand here?
Your logic in reversing the orders is incorrect. You are using a stop order for your sell short. That means that your stop order will be executed any time price is below the high of the last 20 bars, which is pretty much always. If you want to go short at the highest high of the last 20 bars, you need to change your Sellshort line to:

SellShort ("Short") next bar at HighestFC (Price, Length) +1 point limit;
sevensa is offline  
Reply With Quote
The Following User Says Thank You to sevensa For This Useful Post:
hrokling (02-27-2009)
Old 02-27-2009, 03:40 AM   #3

Join Date: Feb 2008
Location: Oslo
Posts: 9
Ignore this user

Thanks: 2
Thanked 1 Time in 1 Post

Re: Turning a Buy into a SellShort (PowerLanguage)

That's great, thank you very much!
hrokling 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
Calculating Intraday Turning Points jpflores Technical Analysis 22 09-04-2008 09:50 AM

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