| 
 PureBytes Links 
Trading Reference Links 
 | 
John,
You should use Flip function.
InLong = Flip( Buy, Sell OR Short );
InShort = Flip( Short, Buy OR Cover );
State = IIF( InLong, 1, IIF( InShort, -1, 0 ) );
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "John Rowlinson" <john@xxxxxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, March 10, 2003 5:30 PM
Subject: [amibroker] Can anyone help
> Hi,
> 
> I just started using AmiBroker having ditched Metastock and am 
> getting to grips with it.
> 
> I want to set a state flag: State = 1 if I am long or -1 if I am 
> short.  I generate momentary signals to go long and the same for 
> short.  They persist only for the trigger bar.
> 
> So I want to do 
> 
> State = IIf(Sellsignal==1, -1, State);
> State = IIf(BuySignal==1, 1, State);
> 
> But it seems I can't set state = state.
> 
> Any ideas how I can do this?
> 
> Thanks
> 
> 
> 
> 
> John Rowlinson
> 
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
> 
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
 
 |