I have very little experience in programming and want to create a very simple trading strategy in MultiCharts.
BUY = If Close (0) > Close (-1) -- buy if close of the current bar is greater than the close of the previous bar AND keep buying if this rule continues i.e. if there are 5 bars in a row each with the close higher than the previous bar then you will have a net LONG 5 lot position.
SELL = If Close (0) < Close (-1) -- sell if close of the current bar is less than the close of the previous bar AND keep selling if this rule continues i.e. if there are 5 bars in a row each with the close lower than the previous bar then you will have a net SHORT 5 lot position.
CLOSE entire LONG position when a SELL signal appears and open a SHORT as per the rule
CLOSE entire SHORT position when a BUY signal appears and open a LONG position as per the rule
I've highlighted two examples in the attached screenshot of how this rule should work.
Default Quantity = 1 lot i.e. every time I open or add to a current position I will only trade 1 lot.
When a reverse signal comes into effect i.e. "Close Longs - Open Short" I would sell off my entire long position and then open 1 position short.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
Making progress and I think I've got it after using the Repeat function although I'm still not sure it'll work.
I get an error that I have no idea what it means and don't see the problem (line 8 is the "buy("BTO")..." line).
------ Compiled with error(s): ------
Orders cannot be inside a loop.
errLine 8, errColumn 5, errLineEnd 8, errColumnEnd 5
causal study: (Function)
Last edited by Zhorny; November 1st, 2012 at 01:16 PM.