strategic w trend

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
gregorio123456
Posts: 117
Joined: 08 Nov 2005
Been thanked: 3 times

strategic w trend

Postby gregorio123456 » 17 Mar 2007

Hi

Is it possible in format objects have 2 strategic .

1strategic give trend up or down
in function of 1strategic.... have 2strategic (read in 1strategic )to tigger signal to buy in trend up or sell in trend down.

or anything to be possible transfer or read value one to other


thanks

gregorio

User avatar
Kate
Posts: 758
Joined: 08 Dec 2006

Postby Kate » 21 Mar 2007

Gregorio123456,

The description is not clear enough. MultiCharts allows you to have either two signals one of which will refer to buy and the other for sell, or one signal that will have both buy and sell.

gregorio123456
Posts: 117
Joined: 08 Nov 2005
Been thanked: 3 times

Postby gregorio123456 » 21 Mar 2007

Gregorio123456,

The description is not clear enough. MultiCharts allows you to have either two signals one of which will refer to buy and the other for sell, or one signal that will have both buy and sell.
No

you see
Function __averagetrend1.
input: price(NumericSeries),length(NumericSimple);
if(close> Average (price,length))then __averagetrend1=1;
if(close< average (price,length))then __averagetrend1=-1;

Strategic RSI.
Input:trend(__averagetrend1(close,270));
Input: length(9),OverSold( 30 ),OverBought( 70 ) ;
variables: MyRSI( 0 ) ;
MyRSI = RSI( Close, Length ) ;
if Currentbar > 1 and trend=1 and MyRSI crosses over OverSold then buy 1 contract this bar close;
if Currentbar > 1 and trend=-1 and MyRSI crosses under OverBought then sellshort 1 contract this bar close;

I have one function give trend and strategic give trigger in trend ok

I Would like this, put in formant object
MovAvg Crooss LE (Standar signal in PL to buy)
MovAvg Crooss SE(Standar signal in PL to sell)
RSI LE (signal default in PL to buy)
RSI SE(signal default in PL to sell)
MovAvg Crooss LE and MovAvg Crooss SE give me trend instead signal buy or sell ,and transfer the information to RSI LE and RSI SE to trigger buy signal or sell sinal in the trend.


Why do I like this ? because I use your Standar signal in PL to give me trend, accord of trend use your Standar signal to trigger buy or sell signal

Thanks
gregorio

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 21 Mar 2007

In this case it makes sense convert signals into the functions and use them in the strategy. It's quite simple.

gregorio123456
Posts: 117
Joined: 08 Nov 2005
Been thanked: 3 times

Postby gregorio123456 » 21 Mar 2007

I have one problems w function w multi-output:

function
_trend
input:price(NumericSeries),length(NumericSimple),otrendup(TrueFalseRef),otrenddown(TrueFalseRef) ;
otrendup=(close>Average(price,length));
otrenddown=(close< Average(price,length));
_trend=true;

Strategic
Input:trend(_trend(close,270,otrendup,otrenddown));
Input: length(9),OverSold( 30 ),OverBought( 70 ) ;
variables: MyRSI( 0 ) otrendup(false),otrenddown(false);
MyRSI = RSI( Close, Length ) ;


if Currentbar > 1 and otrendup and MyRSI crosses over OverSold then buy 1 contract this bar close;
if Currentbar > 1 and otrenddown and MyRSI crosses under OverBought then sellshort 1 contract this bar close;

When I compile strategic, Pl don´t accepted the function _trend in strategic

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 22 Mar 2007

You need to create 2 different functions for otrendup and otrenddown. I.e.


function _otrendup:

if close>Average(price,length) then
_otrendup = true
else
_otrendup = false;


strategy:

if Currentbar > 1 and _otrendup and MyRSI crosses over OverSold then buy 1 contract this bar close;

gregorio123456
Posts: 117
Joined: 08 Nov 2005
Been thanked: 3 times

Postby gregorio123456 » 22 Mar 2007

You need to create 2 different functions for otrendup and otrenddown. I.e.


function _otrendup:

if close>Average(price,length) then
_otrendup = true
else
_otrendup = false;


strategy:

if Currentbar > 1 and _otrendup and MyRSI crosses over OverSold then buy 1 contract this bar close;


thanks
grego


Return to “User Contributed Studies and Indicator Library”