Newbie trying to set up an automated system using New Strategy from Rules and having a challenge. System is: trading on an EMA 16/34 crossover on a 15 minute chart. However, I want to close out the position at end of day. I have no difficulty with the entry position but when I try and set the exit using Sell at Close it assumes the current 15 minute bar, not EOD. Fidelity advises they don't know how to combine different time frames (i.e., 15 minutes and daily). Is this possible and can it be done using rules or does code need to be written? If code, then I'm lost cause I don't have that knowledge.
Any help would be most appreciated.
Size:
Color:
Size:
Color:
Something like that:
CODE:
Please log in to see this code.
Size:
Color:
Thanks Eugene! What's the best resource to learn to write and understand code? Is there anything on the WL site?
Size:
Color:
There are numerous free web resources, books, online classes and so on. By learning a .NET language, preferably C# (the language that Strategy Editor speaks), you will know how to code in Wealth-Lab.
For instance, a selected number of comprehensive online resources is linked in our WL5 Wiki FAQ:
How do I start with C# ?After learning some basic concepts (because programming trading strategies in Wealth-Lab typically does not require more advanced stuff), you'll be able to make a good use of the WealthScript Programming (Language) Guide, QuickRef and the Wealth-Lab Wiki site which contains many solutions and examples.
Size:
Color:
Eugene - One last question. Began reading some of the sites you recommended but need to get some trades going (my learning curve for programming is going to be a long tme). What would be the addition to the script to add an "or" condition to the exit strategy as follows:
an intra-day stop loss of 3%.
I really appreciate your help.
Size:
Color:
QUOTE:
an intra-day stop loss of 3%.
Change the appropriate section with this code snippet, where I also have included a check that prevents entry on the last bar of the day:
CODE:
Please log in to see this code.
QUOTE:
Began reading some of the sites you recommended but need to get some trades going (my learning curve for programming is going to be a long tme).
Then I'd suggest to pick the easiest book, something like "C# for Dummies". Anyway you won't need some obscure programming stuff but the language basics. You're welcome to ask your WealthScript/C# questions here.
Size:
Color:
Very helpful - thanks again!
Size:
Color:
Eugene - in reading through the WLP User Guide it state "AtClose Orders are not supported by the Orders tool". So does that mean my end of day Sell at Close parameter will not execute? If so, can I modify it to sell at a specific time for that day, such as 3:59:00 pm? If so, can you give me the language?
Thanks.
Size:
Color:
If it's the last bar of the market day, I would think a SellAtMarket would for most cases...
Also, in addition to rap's first question how would you approach selling a position at close at after the 2nd market day after purchasing?
-Kip
Size:
Color:
QUOTE:
So does that mean my end of day Sell at Close parameter will not execute? If so, can I modify it to sell at a specific time for that day, such as 3:59:00 pm? If so, can you give me the language?
CODE:
Please log in to see this code.
QUOTE:
Also, in addition to rap's first question how would you approach selling a position at close at after the 2nd market day after purchasing?
Please see this KB article:
Closing Intraday Positions at End of DayWealthScript Translator will turn the WL4 code to C# in a second, you'd only have to remove the
PortfolioSynch line.
Size:
Color:
Rather than getting into the convoluted logic of that KB article, the following is probably sufficiently robust, though you'll have to change the
MarketClose constant value for half days.
CODE:
Please log in to see this code.
Size:
Color: