Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
LIMIT ORDERS for Amibroker (AFL)
If you hope to get a better price on the entry, you might try a limit order. You get complete control over the entry with the following code
Indicator / Formula
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | // EnterAtLimit.afl // // Entry using a Limit Order. // Try to get a better price than the Market Order would give. // // This example uses a simple moving average crossover to // illustrate entering a long position at the market. // // The delay between the signal and the entry is // controlled either by the Settings window or the AFL code. // // For market orders, enter and exit Market On Close // with no delay SetTradeDelays (0,0,0,0); BuyPrice = C ; SellPrice = C ; // The trading system is a simple moving average crossover MA1 = MA ( C ,5); MA2 = MA ( C ,25); // The signal is generated on the bar when MA1 // crosses above MA2 BuySig = Cross (MA1,MA2); // If we can get in at 1% below the Close on the // day the signal was generated, we will enter, // otherwise pass on this signal. Buy = ( Ref (BuySig,-1)==1) AND ( L <0.99* Ref ( C ,-1)); BuyPrice = 0.99* Ref ( C ,-1); // When the sell signal comes, use a Market On Close order. Sell = Cross(MA2,MA1); |
1 comments
Leave Comment
Please login here to leave a comment.
Back
can u please post for short side limit order entry afl