PureBytes Links
Trading Reference Links
|
Hi DIMITRIS,
Thanks for your help!
I see now what I was doing wrong. The structure requires a work-
around, using what you call "cond1, cond2," etc. I was trying to do
something more direct with the code, which did not work. Collecting
all timeframe conditions before writing the BUY/SELL signal code is
the solution, it seems. I will write a revised exploration and
hopefully test it on Sunday eve. I may have a followup post at that
time.
BTW, the interesting thing about this code is that the index signals
you would intuitively think would work, don't backtest so well. I am
assuming this is because I need to look at index signals across
multiple timeframes. Optimization should offer some interesting
insight as to how the market reacts seasonally and in long-term
trends, across these index timeframe signals.
I will also be exploring whether something as sensitive as the
Heikin-Ashi haDiffCO or Tom DeMark Range Expansion Index will work
better for hourly trading, over something like stochastics or MACD,
for the index signals. So far, I've (visually) noticed seemingly
contradictory overlaps work well for index IFT-RSI across multiple
timeframes -- when the daily is coming down, and the hourly is
oversold == BUY hourly. To me, this says the market is "tight" right
now, vs. "loose." Loose would mean both IFT-RSI's could be oversold
before signalling an hourly BUY.
Best regards,
Bman
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS"
<TSOKAKIS@xxxx> wrote:
> Brian,
> You should first define the individual AND the index Stochastic in
> the timeframes.
> Then you may plot them or create the combinatory conditions.
> Here is an example:
>
> //Daily and Weekly individual Stochastic
> //Definitions
> TimeFrameSet( inDaily );
> sD = StochD();
> TimeFrameSet( inWeekly );
> sW=StochD();
> TimeFrameRestore();
> DailyStochD=TimeFrameExpand( sD, inDaily);
> WeeklyStochD=TimeFrameExpand(sW,inWeekly);
> //Graphs
> Plot(DailyStochD, "\nDaily StochD", colorIndigo );
> Plot( WeeklyStochD, "Weekly StochD", colorBlue);
> //Daily and Weekly index Stochastic
> //Definitions
> SetForeign("^NDX");
> TimeFrameSet( inDaily );
> sD_index = StochD();
> TimeFrameSet( inWeekly );
> sW_index=StochD();
> TimeFrameRestore();
> DailyStochD_index=TimeFrameExpand( sD_index, inDaily);
> WeeklyStochD_index=TimeFrameExpand(sW_index,inWeekly);
> //Graphs
> Plot(DailyStochD_index, "\nDaily StochD_index", colorPink ,8);
> Plot( WeeklyStochD_index, "Weekly StochD_index", colorDarkRed,8);
> //Some conditions
> Cond1=DailyStochD<30 AND Cross(WeeklyStochD,WeeklyStochD_index);
> PlotShapes(shapeCircle*Cond1,colorYellow);
> Cond2=Cross(WeeklyStochD_index,DailyStochD_index) AND
DailyStochD>70;
> PlotShapes(shapeCircle*Cond2,colorBlack);
>
> I hope it helps.
> Dimitris
> PS : Above described Cond1, Cond2 are interesting [perhaps] for
> trading signals. Do not put the farm on them, my intension was to
> give a realistic example...
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Brian" <brian@xxxx> wrote:
> > Hello everyone,
> >
> > Is it possible to build a single exploration that will scan
stocks
> > for buy/sell signals AND ALSO at the same time scan an index
> > [using "SetForeign("$SPX")" for example] for other buy/sell
signals
> > as well?
> >
> > How about if I want the index buy/sell signals to look across
> > multiple timeframes of an indicator (for example, the daily AND
the
> > hourly stochastic for the SPX are both below 20 at the same
time)?
> >
> > What if I want to do all of the above, but with multiple indexes
> > (for example, the SPX and VIX, at the same time)?
> >
> > It would be great if someone could throw some sample code for
doing
> > this at me. I've tried doing this a few times, and was about to
> take
> > another stab at it, but thought I would ask you folks first.
I've
> > been writing code all week, and finally need some help.
> >
> > Thanks,
> >
> > Bman
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|