Daily Entry from Intraday Scale
Author: tholly
Creation Date: 11/3/2010 8:30 PM
profile picture

tholly

#1

I am using a base scale of 5 min and have used Set Scale Daily to create the indicators with Daily Bars, then restore scale. and execute in the base scale.

I would like to enter on the next day rather than the next 5 min bar and continue to exit on the 5 min bars.

Can someone help me with the necessary code.

Thanks
profile picture

Eugene

#2
Here's an illustration using a Close/intraday SMA crossover. The code enters on the first bar of the next day:
CODE:
Please log in to see this code.
profile picture

tholly

#3


Eugene

Thank you for the help on the entry code.

I have been working with it for a couple of days and have couple of questions.

I am a little confused. Please explain how the compiler executes the BuyAtMarket command if it is included in an If statement.


I took your code above without changing anything and entered a simple CrossUnder exit to see if it would execute. It executes fine with a Daily base scale, a 60 min, a 30 min and a 15 min. It won't however execute with a 10 min or 5 min base scale. I get a message__Runtime error index out of range. must be non-negative and less than size of the collection. Also several other notes referencing WealthLab.Strategies and System Collections. Tell me what I am missing here.

On different issue that is not peculiar to this routine but any strategy that we run. Why would the But and Hold reference numbers change when you change base scale from Daily to any smaller intra day scale. For example, on a designated 24 month backtest time frame, I have looked at the trades list and each will have its first trade on the same day. It seems that the Buy and Hold gain or loss for that period should be the same.

Also, we a conveerting from one of the older versions to the current Ver 6, and I would like to know if there is any documentation that indexes or lists all of the Key Words, Functions and Commands that are specific to Ver 6. Also is there any other more comprehensive language and programming guide than the WealthScript Programming Guide from Fidelity ??


Thanks again for your help

Tholly
profile picture

Cone

#4
QUOTE:
how the compiler executes the BuyAtMarket command if it is included in an If statement.
It executes it the same way as any other time the function is encountered. BuyAtMarket returns a Position object if a [raw-profit] trade is successful. Otherwise, it returns null. The point is that it's not necessary to process the return value of a function.

QUOTE:
Tell me what I am missing here.
Hard to say, maybe you don't have enough bars loaded.

QUOTE:
any documentation that indexes or lists all of the Key Words, Functions and Commands that are specific to Ver 6.
I can't think of anything that changed for Version 6 along these lines.

QUOTE:
Also is there any other more comprehensive language and programming guide than the WealthScript Programming Guide from Fidelity ??
Any comprehensive programming guide for C# will do just fine. We purposely didn't seek to rewrite the many dozens of books that are already published on the subject. This Wiki KB article has plenty of web references about halfway down the page too.

This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).