PowerLanguage question. Days since, days within...

Questions about MultiCharts and user contributed studies.
stockmacd
Posts: 23
Joined: 28 Feb 2007

PowerLanguage question. Days since, days within...

Postby stockmacd » 26 Jun 2008

I have an function that detects MACD Divergences. How do I program in PowerLanguage that if there's a MACD Bearish Divergence WITHTHIN the last 5 days, to not enter a trade ?

User avatar
TJ
Posts: 6523
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Postby TJ » 26 Jun 2008

Code: Select all

var: condition1 (true);

condition1 =  {MACD divergence within last 5 days};

if condition1 = false then
begin

{your strategy code}

end;

stockmacd
Posts: 23
Joined: 28 Feb 2007

Postby stockmacd » 26 Jun 2008

Thanks TJ,
But I wasn't being clear enough.

condition1 = {MACD divergence within last 5 days};

What is the Powerlanguage function for "within last 5 days" ?

fs

Postby fs » 26 Jun 2008

LRO

User avatar
TJ
Posts: 6523
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Postby TJ » 26 Jun 2008

condition1 = {MACD_divergence[1] and MACD_divergence[2] and MACD_divergence[3] and MACD_divergence[4] and MACD_divergence[5] };


Return to “MultiCharts”