Hello,
How would I go about telling my strategy to only take one trade per session ?
Thank you.
How to have only 1 trade per session [SOLVED]
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: How to have only 1 trade per session
Set up a counter.Hello,
How would I go about telling my strategy to only take one trade per session ?
Thank you.
If the counter <> 1 then
begin your trading logic.
Re: How to have only 1 trade per session
ok,
Please tell me if this is correct :
Is this going to reset my counter for the next day ? or do iactually need to reset at the end of each sesion (day) ?
thanks
Please tell me if this is correct :
Code: Select all
if counter = 0 then
Begin my logic
if marketposition = 1 then
begin
Sell ("longLoss") next bar at XXXX ;
counter = 1;
setexitonclose ;
// Reset of the counter at end of the day
if currenttime = 1801 then counter = 0
;
thanks
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: How to have only 1 trade per session
Developing an autotrade is a thousand refinements on a thousand experiments.ok,
Please tell me if this is correct :
if counter = 0 then
Begin my logic
if marketposition = 1 then
begin
Sell ("longLoss") next bar at XXXX ;
counter = 1;
setexitonclose ;
// Reset of the counter at end of the day
if currenttime = 1801 then counter = 0
;
Is this going to reset my counter for the next day ? or do iactually need to reset at the end of each sesion (day) ?
thanks
Nobody can tell you if this is right, you have to test it out yourself.
I would suggest you to start with a good read on the ebooks in the first post:
viewtopic.php?f=16&t=6929
ps. I have tagged your code for you. You can do the same next time. Simply highlight the code you are able to post and click on the
Code: Select all
button at the top of the message window.
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: How to have only 1 trade per session [SOLVED]
How and when you reset the counter depends on your requirement.ok,
Is this going to reset my counter for the next day ? or do iactually need to reset at the end of each sesion (day) ?
thanks
One of the ways you can reset the counter is:
Code: Select all
if date > date[1] then
counter = 0;