[amibroker] Re: Cannot figure out scaling out

2010-05-13 Thread ovtrad...@ymail.com
For the record, I had to contact support about this and the behavior I was seeing was due to me using trade delays of 1 (i.e. to trade on tomorrow's open). The call to setPositionSize needs to be adjusted to check Ref(Buy, -1) in this case. --- In amibroker@yahoogroups.com, "ovtrad...@..." w

[amibroker] Re: Backtesting vs. Live Trade Reports

2010-05-24 Thread ovtrad...@ymail.com
I'm not the original poster, but am dealing with the same issue. What you suggest helps, and I can figure out how AmiBroker is encoding the scale in data in the Buy/Short arrays. What about stops and profit targets? They don't appear to be visible using the approach below. Thanks. ovt

[amibroker] Re: Backtesting vs. Live Trade Reports

2010-05-26 Thread ovtrad...@ymail.com
Mike -- thanks for taking the time to do this, it looks like that will do the trick. Will check it out. ovt --- In amibroker@yahoogroups.com, "Mike" wrote: > > Hi, > If you want to see the effects of stops, scaling, etc. then you can try > embedding a call to Equity in your script. Here's a

[amibroker] Re: Backtesting vs. Live Trade Reports

2010-05-26 Thread ovtrad...@ymail.com
And here's what I settled on. Tacking this code on the end of my formula and running it as an exploration satisfies my requirements: Equity(1); function formatexitarray(in, def) { //1=normal exit, default character used, X=stop, P=profit target, T=trailing stop, N=n-bar retu

[amibroker] Value for Type field in Application.Import via OLE?

2010-05-26 Thread ovtrad...@ymail.com
What do I pass for the Type field in this API call: Application Function Import(ByVal Type As Integer, ByVal FileName As String, [ByVal DefFileName As Variant]) As Long If it matters, I will be passing a DefFileName parameter as well. I couldn't find this in the docs anywhere, and I'm afraid

[amibroker] Re: Using SetForeign to trade one underlying based on signals from another

2010-05-28 Thread ovtrad...@ymail.com
I suspect, but don't know for sure, you're doing it backwards -- you'd want to test on MSFT since that's what you're trading and do SetForeign to SPY. I think SetForeign changes the price arrays, but not how Buy/Sell/etc are interpreted. Also, you wouldn't want to quote "SymbolToBuy" in tha

[amibroker] Python scripts for AFL execution and data import

2010-05-28 Thread ovtrad...@ymail.com
I suspect my workflow is a bit different than most AB users. I trade futures on daily data which I get from CSI. I import this data from ASCII files which are generated by CSI's desktop app. It didn't seem to me that there was a good way to automate this process using the built in tools (AmiQ

[amibroker] Re: Extracting last record from Text file

2010-05-29 Thread ovtrad...@ymail.com
Check the docs for fgets, the example should get you started. ovt --- In amibroker@yahoogroups.com, "wpok543" wrote: > > The following code extracts the first record from the text file. How would I > extract the last record? > > The Text file looks like this. > "314" > B,06/22/1989 > S,08/22

[amibroker] Re: Request Is there any afl greencolor for bullish zone and red for bearish

2010-06-06 Thread ovtrad...@ymail.com
Ah, thanks for that, I've been wondering if that was possible in AB but haven't gotten around to playing with it yet. ovt --- In amibroker@yahoogroups.com, "Mike" wrote: > > Here's one way to do it. Substitute your own definition of trend. > Fast = MA(Close, 5); > Medium = MA(Close, 25); > Sl