EL or AFL is the most anyone here would ever need. If there is something more complex they cannot handle, then it would probably not work.
Ron, don't listen to guys who don't know. You can find a lot of those in Internet forums.
EL or AFL is the most anyone here would ever need. If there is something more complex they cannot handle, then it would probably not work.
The question was specifically about 2 proprietary languages (Amibroker AFL, Tradestation Easylanguage) 1 platform (NinjaTrader) and an open Programming language (Python).I'm sorry to say but you still don't know. If you don't know then why stating something that is not true or why generalizing? It simply insults the intellect of readers.
For example out of few other softwares (two others not listed in post #1) I've been using Amibroker for quite some time. Now I can assure that you don't no much about the speed for example. You just assume. That's all. Secondly AmiBroker is not tied to one language since it is open architecture.
So what does it mean? It means you a free to use languages like C/C++, NET, Delphi, even Python (I think) etc besides AFL. And in AFL you can bridge to other languages too. Again you first two guys don't know much but you talk about your language and transport some assumptions about other languages or softwares as a whole that are simply wrong. Post #3 is quite a joke at parts too. So as you can see reading horsesh.. like "tied to this and tied to that" or "this is not possible or that is not possible" written by people who just post something for the sake of posting something out of the blue without being sure at all can tear reader's hair out (like mine). And I'm asking myself "why even reading it" since I want to keep my hair.
Like support vector machinesEL or AFL is the most anyone here would ever need. If there is something more complex they cannot handle, then it would probably not work.
The question was specifically about 2 proprietary languages (Amibroker AFL, Tradestation Easylanguage) 1 platform (NinjaTrader) and an open Programming language (Python).
The proprietary languages may be based on open programming languages but they are tailored for use with a specific platform.
Amibroker allows integration with many programming languages? That's great. Good for them.
Any of those programming languages will allow you to connect to many different brokers, unlike AFL.
I write based on my biases, perceptions and previous experiences and I am fallible on my opinions, just like you and anyone else. I even mixed up EasyLanguage with esignal scripting language -ESL- in my original response. Go figure! At the end of the day everyone is subject to error and I participate of this forum and others with the goal of learning and maybe helping someone out everynow and then.
So far your 4 posts here have only been focused on pointing that someone else is wrong and you are right.
If my responses are forcing you to pull your hair out, then by all means click on my nick open the member profile and click on the ignore button. Health comes first mate and there are more productive ways to spend your time.
## imports
import pandas as pd
import pandas.io.data
import numpy as np
import pytz
from datetime import datetime
import zipline as zp
from zipline.finance.slippage import FixedSlippage
## data from yahoo
start = datetime(1990, 1, 1, 0, 0, 0, 0, pytz.utc)
end = datetime(2002, 1, 1, 0, 0, 0, 0, pytz.utc)
data = zp.utils.factory.load_from_yahoo(stocks=['AAPL'], indexes={}, start=start,
end=end, adjusted=False)
## plot the data as a sanity check...
data.plot()
# Class for SMA signal
class DualMovingAverage(zp.TradingAlgorithm):
"""Dual Moving Average Crossover algorithm.
This algorithm buys apple once its short moving average crosses
its long moving average (indicating upwards momentum) and sells
its shares once the averages cross again (indicating downwards
momentum).
"""
def initialize(self, short_window=50, long_window=200):
# Add 2 mavg transforms, one with a long window, one
# with a short window.
self.add_transform(zp.transforms.MovingAverage, 'short_mavg', ['price'],
window_length=short_window)
self.add_transform(zp.transforms.MovingAverage, 'long_mavg', ['price'],
window_length=long_window)
# To keep track of whether we invested in the stock or not
self.invested = False
def handle_data(self, data):
short_mavg = data['AAPL'].short_mavg['price']
long_mavg = data['AAPL'].long_mavg['price']
buy = False
sell = False
if short_mavg > long_mavg and not self.invested:
self.order('AAPL', 100)
self.invested = True
buy = True
elif short_mavg < long_mavg and self.invested:
self.order('AAPL', -100)
self.invested = False
sell = True
self.record(short_mavg=short_mavg,
long_mavg=long_mavg,
buy=buy,
sell=sell)
## Run the program.
dma = DualMovingAverage()
perf = dma.run(data)
## make pretty plots
fig = plt.figure()
ax1 = fig.add_subplot(211, ylabel='Price in $')
data['AAPL'].plot(ax=ax1, color='r', lw=2.)
perf[['short_mavg', 'long_mavg']].plot(ax=ax1, lw=2.)
ax1.plot(perf.ix[perf.buy].index, perf.short_mavg[perf.buy],
'^', markersize=10, color='m')
ax1.plot(perf.ix[perf.sell].index, perf.short_mavg[perf.sell],
'v', markersize=10, color='k')
ax2 = fig.add_subplot(212, ylabel='Portfolio value in $')
perf.portfolio_value.plot(ax=ax2, lw=2.)
ax2.plot(perf.ix[perf.buy].index, perf.portfolio_value[perf.buy],
'^', markersize=10, color='m')
ax2.plot(perf.ix[perf.sell].index, perf.portfolio_value[perf.sell],
'v', markersize=10, color='k')
plt.legend(loc=0)
plt.gcf().set_size_inches(14, 10)
In my research and experience, results from machine learning techniques applied to trading are worth the effort. Today's TSDPs are not adequate for support of them.
SetBacktestMode(backtestRegular);
SetTradeDelays ( 1, 1, 1, 1);
CondLong = MA(Close, 50) > MA(Close,200) AND Ref(MA(Close, 50) ,-1) <= Ref(MA(Close, 200), -1) ;
CondShort= MA(Close, 50) < MA(Close,200) AND Ref(MA(Close, 50) ,-1) >= Ref(MA(Close, 200), -1) ;
Buy=Cover=CondLong;
Short=sell=CondShort;
BuyPrice=ShortPrice=Open;
SetPositionSize( 100, spsShares);
ApplyStop(0,1,5);