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

[amibroker] Re: Would appreciate a code example of a sell stop limit.


  • Date: Sun, 14 Mar 2010 02:36:54 -0000
  • From: "Mike" <sfclimbers@xxxxxxxxx>
  • Subject: [amibroker] Re: Would appreciate a code example of a sell stop limit.

PureBytes Links

Trading Reference Links

Try something like this (untested):

Cond1 = Ref(Signal1, -1);
Cond2 = Ref(Signal2, -1); 
ShortLimit = Ref(Close, -1); 

ShortPrice = Max(ShortLimit, Open);
Short = Cond1 AND Cond2 AND High >= ShortLimit;

Your trade delays for shorting would have to be set to zero.

Mike

--- In amibroker@xxxxxxxxxxxxxxx, "ronspieker" <tip001@xxx> wrote:
>
> For example, you get a trade signal the previous day (EOD data) and you are looking to sell short if the price moves above yesterday's close.
> 
> Cond1= Ref(signal1,-1);
> Cond2=Ref(signal2,-1); 
> Selllimit=Ref(C,-1); Want to sell short for a move above yesterday's close 
> Sellprice=Min(Selllimit,H);
> Short = Cond1 and Cond2 and Cross(H(?), Selllimit); 
> 
> However, using the H seems incorrect since we don't know the high yet and also I am really just looking just looking for a trigger for any move above yesterday's close. I would appreciate a simple example of how to code this, if possible, with EOD data.
> 
> Thanks
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/