Welcome to the Traders Laboratory.

Coding Forum Collaborate, receive help, or discuss indicators and other coding-related topics

Reply
Old 04-10-2016, 11:53 PM   #1

Join Date: Apr 2007
Location: Andalusia
Posts: 24
Ignore this user

Thanks: 3
Thanked 2 Times in 2 Posts

Coding Problem

I am having problems finding new highs or lows when the macd crosses under 0 line.
It seems to plot with cross above zero line. I am trying to reset the time with cross overs of zeroline. With cross over it needs to reset the time and from there start finding new higher highs and lows etc.
Any help would be much appreciated.
Thanks

{Start of code_____EasyLanguage____ _________________________ _____}

var: HH(0), LL(0),TimeOK(false),start (0),var10(0);



{"Macd Added"____Need to reset time or Start as macd crosses over 0 line-from Data2--Then Reset highs and lows and start looking from there for new Highs Lows from new start time____________________}
inputs: FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ) ;

var0 = MACD ( Close , FastLength , SlowLength ) ;
var1 = XAverage( var0, MACDLength ) ;
var2 = var0 - var1 ;

condition1 = var0 {data2 }crosses over 0 {data2} ;
if condition1 then begin
var10=time_s;
var10=time;

start=var10 ;

end;
condition2 = var0 crosses under 0 ;
if condition2 then begin
var10=time_s;
{start=time ;}

start=var10 ;
var10=time;
end;

{High Low find from Time reset }
TimeOK = time >= start ;


if TimeOK = false then begin
HH = high;
LL = low;
noplot(1) ;
noplot(2);
end else begin
if high > HH Then begin
HH = high;

plot1(HH,"HH",red );
end;
if Low < LL then begin
LL = low;

plot2(LL,"LL",cyan );

end;
end;
moneymarkets 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
.dll Problem? ianpal General Discussion 1 03-23-2009 04:37 PM
Tradestation Problem hogarstrasni Beginners Forum 1 02-16-2009 06:33 AM
Log in Problem ian Support Center 5 11-24-2008 04:29 AM
I Have a Problem james_gsx General Discussion 13 07-11-2008 08:24 PM
Problem with overtrading.... kyle Beginners Forum 14 11-06-2006 02:33 AM

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