--- On Sun, 5/9/10, Sidney Kaiser <[email protected]> wrote:
From: Sidney Kaiser <[email protected]> Subject: Re: [amibroker] Mixing daily and RT data values To: [email protected] Date: Sunday, May 9, 2010, 5:32 PM I hate answering my own question... I think I found the answer in the last tutorial on multiple time frames. Apparently the answer is: TimeFrameGetPrice( "H", inDaily, -1 ); While running in RT. Is that right? TIA Sid **************** ******************** Ok, that was too simple minded, doesn't work. How about this code? Will this do the job? In the works of Chandler Bing, " Could it BE more complicated?" /* JB daily O vs C Red line is 8MA Close Blue line is 8MA Open */ /* Calculate the daily values. */ TimeFrameSet(inDaily); Red = MA(Close, 8); Blue = MA(Open, 8); /* Buy setup */ Bsu = Red > Blue; /* Sell setup */ Ssu = Red < Blue; /* Back to RT values */ TimeFrameRestore(); /* Bring in the previous day (pd) calculated values. */ Bsupd = TimeFrameExpand(Bsu, inDaily); Ssupd = TimeFrameExpand(Ssu, inDaily); Hpd = TimeFrameExpand(High, inDaily); Lpd = TimeFrameExpand(Low, inDaily); /* Trigger, taken intra bar in real time. */ Buy = Bsupd AND Close > (Hpd + 0.01); Short = Ssupd AND Close < (Lpd - 0.01); ********** I still need to add the exits and stops. Cheers Sid --- On Sun, 5/9/10, Sidney Kaiser <[email protected]> wrote: From: Sidney Kaiser <[email protected]> Subject: [amibroker] Mixing daily and RT data values To: [email protected] Date: Sunday, May 9, 2010, 5:02 PM I'm sure this question has been answered before but I've not been able to locate it. This situation occurs all the time in real life trading so I'm sure it has been solved before. Using daily EOD data, some conditions are tested and lets say you want to buy 1 tick above yesterday's High (derived from EOD data). The system is now in RT mode looking for that move above some specified level. I can no longer specify Ref(High, -1) because that value is constantly updating in RT. So what code do I use to preserve that EOD previous day high when monitoring new RT ticks coming in today looking for a trigger? TIA Sid
