Is it possible to use the keywords like:
* OpenEntryTime
* EntryTime
* EntriesToday
etc.
with optimization?
I have two trailingstop systems. One for the first trade of the day and another for the second and consecutive trades on a day. With the entrytime and entriestoday keywords I determine when the first or the second trailingstop system must be used. In backtesting this works ok. When trying to optimize the trailingstops (using optimiser on the chart in MC). Then it will run like normal, except it will create only 0 values in the output report.
If I use one trailingstop system and therefore not using the position keywords, optimizing works ok. That's why I question the use of these keywords with optimizing.
Can anyone confirm using these keywords with optimizing?
Strategy Position keywords and optimization [SOLVED]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Strategy Position keywords and optimization [SOLVED]
Hello evdl,
These reserved words work during optimization (they return values like in backtesting).
How exactly do you want to use these reserved words during optimization?
These reserved words work during optimization (they return values like in backtesting).
How exactly do you want to use these reserved words during optimization?
-
- Posts: 401
- Joined: 19 Jan 2011
- Location: Netherlands
- Has thanked: 85 times
- Been thanked: 124 times
Re: Strategy Position keywords and optimization
Hi Henry,
This is the code I use to switch from one TS system to the second TS system
Trigger for the second TS system
The openentrytime and entriestoday are used to switch between the TS system of the first trade of the day and the second trade of the day (two trades in total per day).
This is the code I use to switch from one TS system to the second TS system
Code: Select all
If EntriesToday(date) > 1 or (OpenEntryTime >= Begin_time_entry_2 and OpenEntryTime <= End_time_entry_2) then begin
First_trade_trigger = false;
end
Else begin
First_trade_trigger = true;
end;
If first_trade_trigger then begin
Code of trailingstop system of the first trade here
Code: Select all
If EntriesToday(date) >= 2 or (OpenEntryTime >= Begin_time_entry_2 and OpenEntrytime <= End_time_entry_2) then begin
second_trade_trigger = true;
end
Else begin
second_trade_trigger = false;
end;
If second_trade_trigger then begin
Code of trailingstop system of the second trade here
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Strategy Position keywords and optimization
Hello evdl,
Please provide more details on the exact concept you are tring to implement. What do you mean exactly by "to switch between the TS system"?
Please provide more details on the exact concept you are tring to implement. What do you mean exactly by "to switch between the TS system"?
-
- Posts: 401
- Joined: 19 Jan 2011
- Location: Netherlands
- Has thanked: 85 times
- Been thanked: 124 times
Re: Strategy Position keywords and optimization
Thanks for your reply Henry,
I understand that the position keywords must work with optimization, so it must be something in my code.
I will check my code first, to prevent taking your time, possible for a coding error on my side.
Topic solved for now I guess.
I understand that the position keywords must work with optimization, so it must be something in my code.
I will check my code first, to prevent taking your time, possible for a coding error on my side.
Topic solved for now I guess.