PureBytes Links
Trading Reference Links
|
You need to define your buy and sell signals within the AFL code and
then enter trades via trading interface once the signal is generated.
I posted some code yesterday that may be generally helpful.
Your sell condition cannot be entered as a trailing stop order.
Instead you should define a sell condition in AFL, that triggers a
sell when the when the price of current bar dips below the low of the
previous bar. You can then enter the trade via the IB interface when
LastValue (SELL) is true.
--- In amibroker@xxxxxxxxxxxxxxx, "dralexchambers"
<dralexchambers@xxx> wrote:
>
> Hi - I am looking into automating AB with Interactive Brokers. I have
> been going through the documentation supplied with AB on this.
>
> Is it possible to code an order that does the following from
> Amibroker:
>
> BUY = Cross( Ref(MACD(),-1), Ref(Signal(),-1) );
>
> 1. This buy signal is only triggered when the current candle/bar has
> closed (ie. the buy signal is not triggered when the candle is still
> forming)
>
> SELL = Trailing stop loss
>
> 2. The trailing stop I need is as follows - the stop loss to be
> raised to the Low of the candle just formed, eg:
>
> 5 min chart:
>
> 14:25-14:30 candle low = $100.
>
> Time now = 14:32. Current low = $90. Stop loss is $100, because this
> 5 min candle is still forming, and the low of the 14:25-14:30 candle
> is used
>
> Time now = 14:35, new candle starts. Low of 14:30-14:35 candle = $85,
> so stop loss is now $85.
>
>
> Can this be done - if so, how?
> Thanks,
> Alex
>
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
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:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto: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/
|