Home › Forums › Trading System Mentor Course Community › Progress Journal › Progress So Far
- This topic is empty.
-
AuthorPosts
-
April 12, 2016 at 7:52 am #101476JulianCohenParticipant
Instead of naming this Julian’s Trading Progress, I have left it general so that any of us that are getting through the theory part can see the mentor’s response. Also I haven’t started trading yet so there isn’t really any progress
I am up to the looping section of the course and I just wanted to ask a question that maybe of interest to the others at the same stage. I feel that when I am going through the lessons, the code makes sense to me; I can see why things are written the way they are and the flow of the code is obvious to me. However if I had to write some without referring to the code snippets I have already written, I’m not confident I would get even remotely halfway there.
Is this a common feeling? Do the mentors or the guys further along the course have any words of wisdom to impart
April 12, 2016 at 8:31 am #103553LeeDanelloParticipantYep, Pretty much what you’re saying. AFL is pretty expansive and to remember everything requires a photographic memory. It all comes dow to practice practice practice. The whole idea of the snippets is to utilise as much as you can and then fill in the blanks. I find the logic of the looping easy to remember and difficult to recreate. Having said that I can now see where I’ve made errors and I’m able to correct it because I have the understanding
April 12, 2016 at 9:18 am #103562JulianCohenParticipantOK well that’s good to know. There is a light at the end of the tunnel then :dry:
April 12, 2016 at 10:36 am #103563SaidBitarMemberhere are some tricks that may help:
1- after you see the code in the course open Formula Editor in Amibroker and rewrite the code no need to write it by yourself just type it in at least in the beginning. So you will get used to the syntax later stage you can write it in your own style. The reason for this is that in the beginning most of the mistakes will be syntax errors rather than coding errors such as missing ; typo and so on.
2- if you have idea try not to code it all at once make it small parts at a time, in the course they did great job in this i think it was the ADX system.
3- Flow charts it is useful tool you can do it on a piece of paper write your code or idea in words then you can code it. Regarding looping you can use this trick normally looping is doing certain thing over and over till the condition is not met. So do not think of it as a loop just imagine one step and write what you want the code to do in this step after that add the array formulas ([j] or or whatever character you use) to your code and it will be ok. With time it becomes better and easier.
4- Snippets are good but try to avoid them in the beginning I know that Nick and Craig may disagree but the reason to avoid is to practice. later when you want to code a system you can use them for simplicity and to reduce time.
5- Repetition it works like magic
6- I will be glad to help anytime if i can
April 12, 2016 at 12:43 pm #103564JulianCohenParticipantSaid that is really great advice. Very practical and all techniques that I can see will help. Thank you, and I really appreciate the offer of help.
April 12, 2016 at 8:44 pm #103554Nick RadgeKeymasterOf course there’s progress – you’re using terms like Looping which means you’re on the road to geekdom.
Great advice Maurice and Said. Thanks.
I have always used a template style right back to the early days in the 90’s using TradeStation. I have templates for numerous entries, numerous exits, positions sizing and all sorts of stuff. I can just slot them in where I need.
But as Maurice, says, it becomes clearer as you go forward.
Next 1000 lines of code!
April 12, 2016 at 11:12 pm #103565Stephen JamesMemberI agree with Said that at the beginning it is good to practice writing code as repetition will aid memory retention. I believe there are more than 350 built in functions alone so we are not going to remember them all, but you will gain exposure to the most common ones, which we’ve tried to cover in the course. Just remember Julian, you have just started and it does get a lot easier.
My coding started about 6-7 years ago with explorations for discretionary setups, some custom indicators, then onto systems. Having said the above, I now use snippets or templates constantly so I’m not reinventing the wheel. I also refer to the user guide regularly to check on code that I may not have used before or for a while.
If I get stuck on a concept, usually within 1-2 hours of trying out my initial thoughts, I find the best thing to do in many cases is to ‘walk away’. You’d be amazed at how many coding concepts I solve when not at the computer. Horses for courses there perhaps!
April 13, 2016 at 3:14 am #103566JulianCohenParticipantActually walking away is what I did yesterday. I realised that my brain was fried and I’d never get any further by going through the code again so I had a glass of wine and vegged in front of the TV. After sending you a help email
Today is another day. Thanks for all the words of wisdom guys.
April 13, 2016 at 11:08 am #103571JulianCohenParticipantI decided to take a small break from looping in order to clear my brain.
I spent the day writing some entry code for a system I used to trade a few years ago and that I think could have merits as a mean reversion system, but I won’t know for sure until I have fully worked out how I will use it.
The code what I wrote is below. If anyone can suggest methods to clean it up, or compact it a little I’d be very grateful to see it. This is obviously a work in progress as I haven’t written up the sell signals yet. I know one that I plan to use, but the main exit I haven’t decided on as I need to work out what the mean is that it will be reverting to…
Nick and Craig I hope you don’t think I’m trying to get ahead of myself. I just wanted to see if I could do this myself before pushing on.
Code://===============================BullDB = (C-L)/(H-L)*100;
AlligatorBlue=Ref(Wilders(C,13),-8);
AlligatorRed=Ref(Wilders(C,5),-3);C1 = Outside();
C2 = BullDB > 75;
C3 = AlligatorRed < AlligatorBlue; C4 = H < AlligatorRed; C5 = H < AlligatorBlue; BuySetUp = C1 AND C2 AND C3 AND C4 AND C5; Buy = Ref(BuySetUp,-1); BuyPrice = H + 0.02; Filter = C1 AND C2 AND C3 AND C4 AND C5;April 13, 2016 at 11:25 am #103576SaidBitarMemberMy opinion is that it is clean as it is
Maybe you can add parameters instead of the hard wired values for the sake of flexibility and they will be handy in later stages if you want to modify them so you don’t have to touch your code just you modify from parameters window. My opinion the less we touch the main code the better.
This is totally opposite of what you wanted in compacting the code
Filter = BuySetUp;
There is a tiny mistake in BuyPrice it should reference the previous H not the current
Here is how I will do it
BuyStop = H + 0.02;
Buy = Ref ( BuySetUp,-1) And Ref (BuyStop, -1) <= H;
BuyPrice = max (O,Ref (BuyStop,-1) );April 13, 2016 at 12:05 pm #103577JulianCohenParticipantOK got it. I see what you have done with the BuyPrice code. Thanks for that!
May 2, 2016 at 9:18 pm #103578CAIHuangMemberI just wanted to post on this thread to seek a little help with some coding. I am currently on site so my internet connection is probably too weak to attend a skype session.
I’m on module 12/27 and and trying to suss out the coding entries code.
This is what I have coded up so far and would love some help to see if I am on the right track or what could be changed with an explanation. I’m a bit stuck.
_SECTION_BEGIN (“Example Slow Stoch + ATR Buy Limit Entry”);
//===============================================================
C1 = StochK(5,3) < 10;
C2 = C < (C-1);
BuySetUp = C1 AND C2;
BuyLimit = L < 1.5*ATR(10);
Buy = Ref (BuySetup,-1) AND Ref (BuyLimit,-1) <= L;
BuyPrice = Max(Open,Ref (BuyLimit,-1));Cheers
May 2, 2016 at 10:29 pm #103659Stephen JamesMemberLuke
The first three lines are fine.
A buy limit order is place below the market, in this case, a multiple of ATR below the Low.
Therefore the BuyLimit needs to be the Low minus the multiple : BuyLimit = L – 1.5*ATR(10);Then, in order to trigger the limit price, the next bar needs to penetrate or touch that price. This can occur on open or during the session with the Low of that day.
So the Buy condition needs to dictate that the Low was below or equal to the limit price: Buy = Ref (BuySetup,-1) AND L <= Ref (BuyLimit,-1) ; To account for the possibility of the open price being below the limit the BuyPrice needs to be the minimum of the open or limit price, not the maximum:-
BuyPrice = Min(Open,Ref (BuyLimit,-1));May 3, 2016 at 9:34 pm #103660CAIHuangMemberThanks Craig!
May 5, 2016 at 9:18 pm #103555CAIHuangMemberDoes this trail Stop look right for the dollar stop in the modules?
_SECTION_BEGIN (“Dollar Stop”);
//===============================================================
PF = Paramfield(“Price Field”,1); //Price field default to High
StopD = Param(“Trailing Stop $”,0.5,1,1000,0.1);
TrailStop = PF – StopD;
In one of the examples there was a 1- in front of the param function:
PF = Paramfield(“Price Field”,1); //Price field default to High
StopP = 1-Param(“Trailing Stop %”,20,1,100,0.1)/100;
TrailStop = PF * StopP;Does that 1- refer the the “price field” being true and the “trailing stop” being subtracted from the “price field”?
Cheers
-
AuthorPosts
- You must be logged in to reply to this topic.