Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help with coding #437695
02/23/14 12:22
02/23/14 12:22
Joined: Feb 2014
Posts: 180
R
RTG Offline OP
Member
RTG  Offline OP
Member
R

Joined: Feb 2014
Posts: 180
This is something I would like to backtest. It is a simple strategy for which I want to see is profitable over a broad range of instruments. I heard it on a podcast last year with a trend following trader.

Basically the buy signal is to enter if the price rises 20% from a low point, and to sell when the price falls 20% from the first highpoint after entering the trade. The goal is to capture the middle meat of a trend.

The problem I have is in coding the strategy. I have read through the tutorials and very little of the coding has made sense to me at this stage.

Re: Help with coding [Re: RTG] #437723
02/24/14 14:28
02/24/14 14:28
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
The first step is describing the strategy in words, as precise as possible.

For instance, "rises 20% from a low point" is ambiguous. 20% of what? Once you got a precise description, the coding step is easy.

Re: Help with coding [Re: jcl] #437749
02/24/14 21:46
02/24/14 21:46
Joined: Feb 2014
Posts: 73
Montreal, Qc Canada
F
Finstratech Offline
Junior Member
Finstratech  Offline
Junior Member
F

Joined: Feb 2014
Posts: 73
Montreal, Qc Canada
I think he means (p2-p1)/p1×100 = 20

Re: Help with coding [Re: Finstratech] #437775
02/25/14 23:33
02/25/14 23:33
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
That would be easy to code, only problem is that it would hardly ever enter a trade, so he probably meant something else.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1