Hi guys. Have a feeling this will be a fairly simple answer but I'm trying to understand how the indicators with multiple outputs are handles in zorro? In metatrader for example you slected the outputs with buffers and associated numbers.
I know the example code is incorrect but posting it as an example. Say I'm trying to get the MACD histogram output where MACD is in the string of outputs. Or the Stochastic K line for example.
StartDate = 20190101; // start two years ago
BarPeriod = 15; // minutes per bar bars
LookBack = 100; // needed for scale()
var PredictHorizon = -3;
set(RULES); // generate signals
LifeTime = 3; // prediction horizon
Spread = RollLong = RollShort = Commission = Slippage = 0;
I know this is probably a very simplistic question but I just can't seem to get my syntax right!
Well, it isn't dataNew, but it's very weird. I could copy the failing script to a new file and it would run without problems. Same thing happened with another script. No idea if it's filename length or what. Perhaps a Wine glitch. No time now to copy stuff over to a real Win & try there... For now close this pending further debugging when time allows.
Hi, just for the sake of completeness. I've been informed by Zorro support that markovitheReturn() has changed. In earlier version there was a normalization and 1 corresponded to a large variance. Now you have to use large values (100-1000) to get the maximum return.
Another point: The EFrontier.c script in the 2016 script repository does not work as expected, the heatmap works but the graphic shows too low values. That is because the scripts calculates daily values, whereas on the Financial Hacker blog annual values are shown.
IB tracks at the position level. So what you’re seeing in the IB chart is your combined position which is not any sort of exchange price. If you enter a buy limit for a short spread that’s saying that you will buy the position back at that price which generates a debit (a positive number). If you enter a negative value that tells IB you want to open a credit spread (a negative number) which would get you shorter your straddle. The chart is misleading because it just prints the position price. A stop loss would be a debit that’s greater than the credit you received. For example you enter a stop loss at 5. That means that volatility has increased and its now more expensive. The net trade would be -3.87+5=1.13 debit or loss on the trade.
In my experience this gets a bit counterintuitive especially when your spread goes OTM. One way to get a feel for this is to trade manually in your IB demo account.
Thank you for your recommendations. >> Yes, I use the tick() function in the script. >> I will try the timeframe=1 suggestion before each entry call and see it if there's a a change.
(I don't want to use hedge = 5 because I need the long and short trades to exist simultaneously.. not the net position).
When I run a backtest with hedge =2, the trades occur at various points within the 30 minute bar as intended. When I test it live, the trades are bundled up and placed at the start of each bar <--- this is different from the backtest behaviour.
Just a quick update on this - following on from Zhekas suggestion I did the following:
Set BarPeriod to 5minutes, then used TimeFrame = frameSync(12); for use in creating various indicators that represented a 60minute period (I found this more stable than the 30 minute periods I was using before). I could then also set TimeFrame = 1; so that I could use a faster price and frequency to check if this crossed my MA every 5 minutes rather than every 60.
Seems to be doing what I expect, however, I will continue to analyse my exits as not totally happy there yet.