logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Andreal  
#1 Posted : Wednesday, June 14, 2006 1:28:10 PM(UTC)
Andreal

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 2/6/2006(UTC)
Posts: 15

Hi! How can I optimize parametres in my own indicator, while testing my trading system? And are there any debuging tools in MS? For example, I don't know why my system buys or sells, where can I watch the value of an indicator?
wabbit  
#2 Posted : Thursday, June 15, 2006 2:20:24 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Andreal, If my assumptions are correct, you have system test that contains fml("myfunction") and you want to optimise the values in the function "myfunction" for your system test? [Some people might call this 'data mining' or 'curve fitting' and actively discourage it; but I am not sure what you are trying to achieve, so I will go along with your query for the mean time.] What value does the function return? Is it true (1) or false(0) or does it return a number? There are a couple of possibilities, but to answer the question, you will need to post your code for the system test and the indicator. Without seeing the code, I am just making assumptions that could do nothing but lead you astray. wabbit :D
Andreal  
#3 Posted : Thursday, June 15, 2006 7:56:16 AM(UTC)
Andreal

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 2/6/2006(UTC)
Posts: 15

Wabbit, you've understood me correctly, I want to optimize MACD. I don't like the built in one, so I've written my own. And I want to optimize FastMA, SlowMA and SignalMA. My MACD: [code:1:0996a48be4] shortperiods:=Input("Enter the shorter MACD periods: ",3,100,50); longperiods:=Input("Enter the longer MACD periods: ",21,500,70); Mov(C,shortperiods,E)-Mov(C,longperiods,E); signal:=Input("Enter the number of signal line periods: ",3,50,9); Mov(Mov(C,shortperiods,E)-Mov(C,longperiods,E) ,signal,E) [/code:1:0996a48be4] System (for example): Buy: cross(My MACD,0) AND cross(MyMacd Signal,0) Sell: vica versa
wabbit  
#4 Posted : Thursday, June 15, 2006 8:28:01 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Ok... What you are attempting is data mining. I do not recommend it.... but here we go anyway! The most simple way is to just copy the indicator code into the Buy and Sell criteria sections of the EST: {Buy} shortperiods:=Opt1; longperiods:=Opt2; signal:=Opt3; myMACD:=Mov(Mov(C,shortperiods,E)-Mov(C,longperiods,E) ,signal,E) Cross(myMACD,0) {Sell} shortperiods:=Opt4; longperiods:=Opt5; signal:=Opt6; myMACD:=Mov(Mov(C,shortperiods,E)-Mov(C,longperiods,E) ,signal,E) Cross(0,myMACD) NOTE: There are 6 optimising variables here. If you let each opt have, say, 10 values then that is one milion computations, running over 2000 stocks, thats 2 BILLION (2,000,000,000) computations that have to be made! If you let the 4 MA values have say 20 values and the 2 signal MAs have 10 values then you are looking at 16 million computations, over 2000 stocks is 32 BILLION (32,000,000,000) computations! Either way, its going to take some time, and burn some CPU's. Secondly, If you really think that MACD crossover system would make you a profit, that everyone would already be using it? I reckon it has been tested before by a thousand people. Other than a learning experience, I do not recommend fitting the values to match the curve. $0.02 Hope this helps. wabbit :D
Andreal  
#5 Posted : Thursday, June 15, 2006 12:46:07 PM(UTC)
Andreal

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 2/6/2006(UTC)
Posts: 15

Thank you very much, Wabbit! But about my second question about a debugger - does it exist?
wabbit  
#6 Posted : Thursday, June 15, 2006 1:00:44 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
You can review every bar and every trade in the system tester results. wabbit :D
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.