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

Re: [Metastockusers] Re: Help with WriteIF and Expert



PureBytes Links

Trading Reference Links




Larry,
The method is simple. The Expert cannot accept 
variables as in the formula builder. So the alternative is, to either specify 
the variable before the condition, or write the code in the formula builder, and 
call the formula every time you need it.
The simpler alternative would be to create the 
code in a formula.
And instead of using the > or < symbols, 
use the cross(), because you want to identify the particular day, when the 
condition was met.
Excuse me, but the pressures of time do not allow 
me to test my code, but I request you to please try and build on 
this.
 
writeif(M1:= max(Mov(C,50,S), 
Mov(C,100,E);M2:= max(Mov(C,150,E), M1);cross(C, M2), "Exit 
Long. ")\
I have written it line by line for the simplicity 
of expression. You can remove the line breaks in your code.
Best wishes.
DusantChief Architect<A 
href="">www.candlestrength.com
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  lseldin 
  To: <A 
  title=Metastockusers@xxxxxxxxxxxxxxx 
  href="">Metastockusers@xxxxxxxxxxxxxxx 
  
  Sent: Thursday, February 12, 2004 00:38 
  AM
  Subject: [Metastockusers] Re: Help with 
  WriteIF and Expert
  Dusant,I am having a problem with the code sample 
  from you. Remember, my "Enter Long" and "Enter Short" are working as 
  planned. It's the "Exit Long" and "Exit Short" that's the 
  problem.So I'm not sure about your code. Also, your "M:=" is giving me 
  problems.Could you elaborate on how to write the Exit 
  Long?Thanks much,- <A 
  href="">larryTAKOUT@xxxxxxxxxx----------------------------------------------------- 
  In Metastockusers@xxxxxxxxxxxxxxx, "Dusant@xxxx" <dusant@xxxx> 
  wrote:> Larry,> >From a cursory glance at the conditions 
  for the writeif(), I think you can use this method.> 
  writeif(> M:=> Highest:= max(Mov(C,50,S), Mov(C,100,E);\> 
  max(highest, Mov(C,150,E))\> cross(c, M),)),"Enter Long. ")> and 
  the reverse for shorts.> Tell us if it works.> Dusant> 
  Chief Architect> www.candlestrength.com>   ----- 
  Original Message ----- >   From: lseldin >   
  To: Metastockusers@xxxxxxxxxxxxxxx >   Sent: Wednesday, 
  February 11, 2004 22:40 PM>   Subject: [Metastockusers] Help 
  with WriteIF and Expert> > >   I am having a 
  problem with my Commentary on an Expert that I have.> 
  >   The Enter Long and Enter Short work well. > 
  >   **** However, my Exit Long and Exit Short are not working 
  well.> > >   The idea is to go long when close 
  is above all 3 moving averages>   and to go short when close 
  is less than all 3 moving averages.> >   Also to Exit 
  Long any position, when these conditions are not met. >   
  Meaning if I am in a long position and the moving average goes below 
  >   one of these MA, then exit.> >   
  Also to Exit Short any position, when these conditions are not met. 
  >   Meaning if I am in a short position and the moving 
  average goes above >   one of these MA, then 
  exit.> > >   
  Writeif(C>Max(Max(Mov(C,50,S),Mov(C,100,E)), Mov(C,150,E)),"Enter 
  >   Long. ")\>   
  Writeif(C<Min(Min(Mov(C,50,S),Mov(C,100,E)), Mov(C,150,E)),"Enter 
  >   Short. ")\> >   **** These are 
  the 2 problem statements:> >   
  Writeif(C<Max(Max(Mov(C,50,S),Mov(C,100,E)), Mov(C,150,E)),"Exit 
  >   Long. ")\>   
  Writeif(C>Min(Min(Mov(C,50,S),Mov(C,100,E)), Mov(C,150,E)),"Exit 
  >   Short. ")\> >   Thanks 
  much,> >   larryTAKOUT@xxxx







Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/Metastockusers/ 
To unsubscribe from this group, send an email to:Metastockusers-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.