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

Reply
Old 03-31-2009, 08:18 AM   #1

Join Date: Dec 2008
Location: Westport
Posts: 14
Ignore this user

Thanks: 2
Thanked 0 Times in 0 Posts

Coding Help for TS

I'm trying to run the following indicator in a RadarScreen window. Basically, I want to set an alert (and possibly run it in a scanner) to test when new momentum high/low is made as measured by the below oscillator. I'm running into a problem where TS "locks up" and send off alerts continuously even though I have "Once per bar interval" checked. Does the code need to be altered?

inputs: shortMA(3), longMA(10);
vars: FastOsc(0);

FastOsc=averagefc(c,short MA)-averagefc(c,longMA);

if FastOsc=highest(c,30) then
plot1(FastOsc,"Momo high");
alert("Momentum High");

if FastOsc=lowest(c,30) then
plot2(FastOsc,"Momo low");
alert("Momentum High");
blib is offline  
Reply With Quote
Old 03-31-2009, 08:49 AM   #2

Blu-Ray's Avatar

Join Date: Nov 2006
Location: England
Posts: 508
Ignore this user

Thanks: 164
Thanked 292 Times in 105 Posts

Re: Coding Help for TS

Quote:
Originally Posted by blib »
I'm trying to run the following indicator in a RadarScreen window. Basically, I want to set an alert (and possibly run it in a scanner) to test when new momentum high/low is made as measured by the below oscillator. I'm running into a problem where TS "locks up" and send off alerts continuously even though I have "Once per bar interval" checked. Does the code need to be altered?

inputs: shortMA(3), longMA(10);
vars: FastOsc(0);

FastOsc=averagefc(c,short MA)-averagefc(c,longMA);

if FastOsc=highest(c,30) then
plot1(FastOsc,"Momo high");
alert("Momentum High");

if FastOsc=lowest(c,30) then
plot2(FastOsc,"Momo low");
alert("Momentum High");

You need to insert a begin and end to the if statements...... because the way it stands at the moment, the if statement is only looking to plot. The alert isn't included within that statement. It should look like this.....

inputs: shortMA(3), longMA(10);
vars: FastOsc(0);

FastOsc=averagefc(c,short MA)-averagefc(c,longMA);

if FastOsc=highest(c,30) then begin
plot1(FastOsc,"Momo high");
alert("Momentum High");
end;

if FastOsc=lowest(c,30) then begin
plot2(FastOsc,"Momo low");
alert("Momentum Low");
end;


Hope this helps

Blu-Ray
__________________

“ Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want ” – Eric Schmidt, Google
Blu-Ray is offline  
Reply With Quote
The Following User Says Thank You to Blu-Ray For This Useful Post:
blib (03-31-2009)
Old 03-31-2009, 08:53 AM   #3

Join Date: Dec 2008
Location: Westport
Posts: 14
Ignore this user

Thanks: 2
Thanked 0 Times in 0 Posts

Re: Coding Help for TS

Blu-ray,

Do you know how to set this up in scanner so that it can be applied on a broader list of sybmols that aren't otherwise in my radar screen?
blib 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
TICK Coding Help Soultrader Coding Forum 19 04-06-2009 02:28 AM
Coding Help PeterBrazel Coding Forum 11 03-22-2009 04:44 PM
CQG - Coding Papa Lazarou Coding Forum 4 01-12-2009 08:13 PM
Coding Help waveslider Coding Forum 1 08-03-2007 04:48 PM
[VSA] Coding TinGull Coding Forum 2 03-18-2007 01:05 PM

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