[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can metastock do flip flops?



PureBytes Links

Trading Reference Links

Onno ... I often use the concept you describe

my method is

position:=if(golongpulse,+1,
              if(goshortpulse,-1,0));

the variable "position" now will be +1 if we have had one or more golong pulses

it will be -1 if we have had one or more goshort pulses and will be 0 if we
have had neither

The variable can be used from withing the expert, or system tester via the
fmlvar function.

Regards ... Martin



Onno Goedknegt wrote:

> Steve,
>
> I am looking for the same.
>
> So...
> If LONG,  then value = +1
> If SHORT, then value = -1
>
> Onno
>
> At 10:51 27-9-98 +0100, you wrote:
> >I would appreciate some help!   In an indicator or system test,  if we
> >assume
> >a buy signal is on condition A  ( any conditional statement)
> >and a sell  signal is on condition B, ( a different conditional statement)
> >
> >How do I write it so that once the buy signal is given, next the tester is
> >only looking for the sell signal?
> >
> >If I use a nested if statement, such as;  If (condA, 1, if(condB, -1, 0),
> >then each day, it is checking for condition A to be true, which I do not
> >necessarily want it to do.
> >
> >What I am after is for the tester to flip flop from one state, search for
> >cond B when long, to the other state, search for condition A when short.
> >How to do this in MS?
> >
> >Thanks in advance.
> >
> >
> >
> >