data1 must be of a faster fractal than the rest of the data series...
ie. to make your multi-data strategy work, data1 must have more ticks per minute than data2 .
That's true, but in this case exchanging data 1 for data 2 would probably not work since he needs to trade data 1 (the option) and orders cannot be submitted for the second data series.
The close of data2 crossing the price is only valid when this happens. The next bar or tick if you use IOG in data1, it can not be valid anymore. If you want this to be valid until a bar is formed in data1, you should use a variabel which can be set to true of false when the crossing takes place in data2 and use this variabel to create the signal when the data1 bar is formed.
You also should reset this variabel, for example after taking a position. Otherwise you will get a lot of signals.
Do you might have an example of that? I cannot make it work (perhaps wrong setting?):
Code: Select all
[IntrabarOrderGeneration = true]
Variables:
averagePrice(0),
buySignal(false);
// Calculate average on the close of data 2
if (BarStatus(2) = 2) then begin
averagePrice = XAverage(Close Data2, 9);
buySignal = (Close Data2 > averagePrice) and (Close[1] data2 <= averagePrice);
end;
// Generate signals
if (buySignal = true) then
buy ("EL") next bar at market;
// Exit the position at the bar close of data 1
if (MarketPosition(0) > 0) and (BarStatus(1) = 2) then begin
sell ("XL") next bar at market;
end;
The setup highlighted in orange is not taken because it did not coincide with a bar close of data 1:
So, where are the signals?!
Is there a reason why you need a non-time based resolution as data 1? Can you not plot the option with seconds bars? That would give data1 more bars (even though they might be empty) than data 2.
In addition, is there a reason why data 1 is plotted to Trade, and not bid/ask? They are probably a lot more bid/ask updates in the option than trades, so changing the quote field might lead to a data 1 with more price bars.