RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



When i must start my MACD calculation? Expand / Collapse
Message
Posted 9/1/2009 15:19:58 Post #9297
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
Hi, i am using a strategy with the MACD indicator and i am not sure if i understand well when i should start its calculation...

I am using the MACD(12,26) combined with a EMA(9) of this MACD (the signal)
When i dowload an historical data based on 1min interval for the last day, i compare the
curve to yahoo's MACD curve and all match.I want my macd graph (plotted real time in my strategy) to be equivalent to the history graph with a macd (when i compare at the end of the day).

Basically, in this case, to see the first 2 points of the MACD and its signal plotted on the graph, i would need to get 26 previous periods of data (at this time the MACD is ready), and i need for the signal 9 periods of the MACD....
So i need to calculate 26+9=35 bars before being able to evaluate my MACD with the signal.

Here is my actual question : Do you guys would start 35 bars before 9h30?
If so, do you get the last 35 bars from pre-market (starts at 8h55) or from last
valid trading hours (3h25pm to 4pm)?

Thank you!
Posted 9/1/2009 21:04:28 Post #9299
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
You need to set the live lead bars to 35 if you want the system to load those bars. Otherwise, it will just start with the live data, so if you started the system at 9:30 it would wait for 35 live bars to come in before there would be a value for the MACD, which would likely prevent it from trading before then.

If you do set the live lead bars to 35, it will load the most recent 35 bars from your data store. If you have pre-market data in your data store it will load those, if the last bar is at yesterday's close, it will load the bars ending with that.

Thanks,
Daniel
Posted 9/1/2009 21:17:57 Post #9300
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
Thank you for the reply, could you tell me where is the live lead bar setting?
Posted 9/1/2009 22:06:45 Post #9302
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
Sorry i found it...propertie window
Posted 9/1/2009 22:14:42 Post #9303
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
I can see that the NewBar() method is called during the lead bar period...what is the purpose of the lead bar attribute if i have to handle it manually in NewBar()...
I was expecting that if i set lead bars to 35, i get the first NewBar() call at the 36nth bar...
Posted 9/1/2009 22:44:13 Post #9305
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
During the lead bar period, bar (or tick) data is processed but no trading occurs. You won't be able to open a position during this period. However, you may have data processing logic in your NewBar method in addition to trading logic. So we call NewBar during this period. You can check the SystemData.InLeadBars property to determine if you are in the lead bars or not.

Thanks,
Daniel
Posted 9/2/2009 00:18:17 Post #9308
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
Ok, thank you
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: billb, young, dplaisted

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 6:13am

2005-2007 © RightEdge Systems