Multi TimeFrame how to display different MA
Multi TimeFrame how to display different MA
10 Jun 2014, 15:42
Hi,
How to change parametr when change chart TimeFrame (if M1 ---> Param = 0; if M15 param = 100)?
I need display different MA on each timeframe?
Thanks
Replies
breakermind
12 Jun 2014, 09:28
RE:
Hi and thanks,
I have this:
public override void Calculate(int index) { // access to different series var weeklySeries = MarketData.GetSeries(TimeFrame.Weekly); // open price bars double open = weeklySeries.Open[index]; Print(open); // If first bar is first bar of the day set open Week1Open[index] = open; }
How get Week open price and draw line on this price ? what is wrong ?
@breakermind
Spotware
12 Jun 2014, 09:33
RE: RE:
breakermind said:
Hi and thanks,
I have this:
public override void Calculate(int index) { // access to different series var weeklySeries = MarketData.GetSeries(TimeFrame.Weekly); // open price bars double open = weeklySeries.Open[index]; Print(open); // If first bar is first bar of the day set open Week1Open[index] = open; }How get Week open price and draw line on this price ? what is wrong ?
index is wrong. The weeklySeries object has different indexes.
@Spotware
breakermind
12 Jun 2014, 09:46
RE: RE: RE:
Spotware said:
breakermind said:
Hi and thanks,
I have this:
public override void Calculate(int index) { // access to different series var weeklySeries = MarketData.GetSeries(TimeFrame.Weekly); // open price bars double open = weeklySeries.Open[index]; Print(open); // If first bar is first bar of the day set open Week1Open[index] = open; }How get Week open price and draw line on this price ? what is wrong ?
index is wrong. The weeklySeries object has different indexes.
Cool,
something is wrong with this spotware cAlgo,
if do not hang it terribly slow ... shows some strange results ... in backtests
Support helpful as usual ...
... defeat.
Bye.
@breakermind
aysos75
11 Jul 2015, 15:01
RE: RE: RE: RE:
breakermind said:
Spotware said:
breakermind said:
Hi and thanks,
I have this:
public override void Calculate(int index) { // access to different series var weeklySeries = MarketData.GetSeries(TimeFrame.Weekly); // open price bars double open = weeklySeries.Open[index]; Print(open); // If first bar is first bar of the day set open Week1Open[index] = open; }How get Week open price and draw line on this price ? what is wrong ?
index is wrong. The weeklySeries object has different indexes.
Cool,
something is wrong with this spotware cAlgo,
if do not hang it terribly slow ... shows some strange results ... in backtests
Support helpful as usual ...
... defeat.
Bye.
In the 'Calculate', 'index' is the index of the current timeframe candles eg M1. But if you want to retrieve values OLHC (Open High Low Close) a candle from another timeframe eg H1, we can not do it with 'index' because the index of the two series corresponding to the two timeframes are distinct. We must use the conversion method GetIndexByExactTime ( (MarketSeries.OpenTime [index]) or GetIndexByTime (MarketSeries.OpenTime [index]).
@aysos75
Spotware
11 Jun 2014, 09:08
You can check the TimeFrame in the code:
@Spotware