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

Reply
Old 11-14-2009, 06:13 AM   #1

Join Date: Jul 2009
Location: Paphos
Posts: 36
Ignore this user

Thanks: 9
Thanked 6 Times in 1 Post



Entry Off Trigger Bar

Hi All,

I am struggling to code the following for TS 8.6.....

I have a simple moving average cross over system.

The bar on which the averages cross should be deemed to be the Trigger Bar, i.e. fast average crosses over slow average, then this bar = Trigger Bar.

What I am trying to do is then set an entry, which would be to enter at the high of the trigger bar plus 50% of the range of the trigger bar.

The if the order is not filled within 5 bars, cancel the order,

Below is a mix of the EL code and statements of what I want the code to do.

Many thanks for all your continued help guys, it has been a massive help to me as an easy language newbee.

Quote:
Input: SlowLength(20), FastLength(60);

Var: Value1=average(close, slowlength);
Value2?Average(close, fastlength);

If Value1[1]<Value2[1] and Value1>Value2 then begin

This bar = Triggerbar;
End;

Value3=Range of TriggerBar / 100 * 50;
Value4=High of TriggerBar+Value3;

If TriggerBar[0] or If TriggerBar[1] or TriggerBar[2] Or TriggerBar[3] or TriggerBar[4] or TriggerBar[5] then begin

Buy next bar at Value4 stop;
End;
nab999 is offline  
Reply With Quote
Old 11-14-2009, 11:37 AM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,589
Ignore this user

Thanks: 2,027
Thanked 1,402 Times in 862 Posts



Re: Entry Off Trigger Bar

... a chart,

with lines and arrows... pointing to the trigger points,

and notes,

describing your thoughts on how and why it triggers,

will always help you see through the smoke and noise.




p.s. one tip: when you are describing the trigger point,
always make observation (and notes) on the bar before, and the bar after.
this exercise you will help see your logic emphasized, clarity enhanced, and confirmation reiterated.
__________________


..........This is a terribly difficult question to answer. The only satisfactory answer is: "It depends"...
Tams is online now  
Reply With Quote
Old 11-14-2009, 02:28 PM   #3

Join Date: Jun 2007
Location: MC
Posts: 46
Ignore this user

Thanks: 4
Thanked 24 Times in 16 Posts



Re: Entry Off Trigger Bar

Set a state for the condition and remember the state. Reset the state only after a trade has been made or the endBar has been hit. numEntryBars is the number of bars for the delay, which is 5 in your case.

https://www.tradestation.com/Discuss...Topic_ID=91786
Attached Thumbnails
Entry Off Trigger Bar-2009-11-14_132433.gif  
3monkeys is offline  
Reply With Quote
The Following User Says Thank You to 3monkeys For This Useful Post:
nab999 (11-15-2009)
Old 11-15-2009, 05:51 AM   #4

Join Date: Jul 2009
Location: Paphos
Posts: 36
Ignore this user

Thanks: 9
Thanked 6 Times in 1 Post



Re: Entry Off Trigger Bar

Hi 3monkeys, many thanks for your reply.

Could you tell me how to alter the entry please.

With the above code the entry is the high of the trigger bar + x number of points.... what I am looking for is to have the entry price at the high of the trigger bar, plus 50% of the range of the trigger bar.

Again, many thanks.
nab999 is offline  
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Painting 'trigger' Bar Color to Scalper Alert simterann22 Coding Forum 6 06-10-2009 08:19 PM
Impossible Entry Minis Trader General Discussion 1 12-30-2008 04:44 AM
Afraid of Pulling the Trigger? Soultrader Trading Articles 7 11-23-2008 09:21 AM
ECN Order Entry Basics Sledge Beginners Forum 12 09-20-2008 09:43 AM
Entry using pivot points Mr.Money Technical Analysis 4 01-26-2008 12:57 PM

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