Hi,
I want to optimize a trading system to find its best settings.
I need your help for a part of the code
Let's take a simple example:
I have an indicator which give good buy signals. I want to find best settings to use it.
I would like to create an indicator which sell every high/top after I have this buy signal.
I know it's artificial... but it helps to find the best parameters for my buy indicator.
So, how can I create a signal which gives the high/top price after a buy signal and which sell short?
Fake signal to optimize parameters
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Fake signal to optimize parameters
First, you have to describe your definition of "high/top".Hi,
I want to optimize a trading system to find its best settings.
I need your help for a part of the code
Let's take a simple example:
I have an indicator which give good buy signals. I want to find best settings to use it.
I would like to create an indicator which sell every high/top after I have this buy signal.
I know it's artificial... but it helps to find the best parameters for my buy indicator.
So, how can I create a signal which gives the high/top price after a buy signal and which sell short?
eg.
higher than previous bar's high?
or, higher than all the highs of the previous 5 bars?
also, what is a top?
-
- Posts: 159
- Joined: 20 Nov 2010
- Location: France
- Has thanked: 76 times
- Been thanked: 34 times
Re: Fake signal to optimize parameters
Hello TJ,
Sorry for my english! Not easy to explain it being froggy
High/Top as I thought => Higher than all the highs on a definite period after my buy signal ( or the first higher after my buy signal, like a peak on Metastock).
--
Laurent
Sorry for my english! Not easy to explain it being froggy
High/Top as I thought => Higher than all the highs on a definite period after my buy signal ( or the first higher after my buy signal, like a peak on Metastock).
--
Laurent
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Fake signal to optimize parameters
Your English is fine.Hello TJ,
Sorry for my english! Not easy to explain it being froggy
High/Top as I thought => Higher than all the highs on a definite period after my buy signal ( or the first higher after my buy signal, like a peak on Metastock).
--
Laurent
If you are concerned, you can always post in your native language.
We will use Google Translate to understand you.
http://translate.google.com/#
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Fake signal to optimize parameters
you can give this a try:
the optimizer will let you run through the "look.back" period to see which is the optimal value.
Code: Select all
Input:
look.back(5);
var:
my.high(0);
my.high = highest( high, look.back);
if h > my.high[1] then
sellshort ("SS") next bar at market;