how come this isn't working?
vars: counter ( 0 );
If marketposition = 0 and marketposition[1] <> 0 and netprofit < netprofit[1] then begin
counter = counter + 1;
end;
counter isn't counting but netprofit is changing
Help requested trying to track losing trades in a strategy
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Help requested trying to track losing trades in a strate
1. please use code tag when posting codes.how come this isn't working?
vars: counter ( 0 );
If marketposition = 0 and marketposition[1] <> 0 and netprofit < netprofit[1] then begin
counter = counter + 1;
end;
counter isn't counting but netprofit is changing
2. MarketPosition(PosBack) <-- note bracket type
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Help requested trying to track losing trades in a strate
Can you write out in plain English what you would like the logic to achieve?thanks for helping but that wasn't it...
the netprofit code isn't working.. took it out and it counts fine
Re: Help requested trying to track losing trades in a strate
If the last trade was a losing trade then add that trade count to a cumulative total of losing trades.
For example today there are 4 losing trades so far i.e. counter = 4
For example today there are 4 losing trades so far i.e. counter = 4
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Help requested trying to track losing trades in a strate
There are a few errors.If the last trade was a losing trade then add that trade count to a cumulative total of losing trades.
For example today there are 4 losing trades so far i.e. counter = 4
Let's start with the first one.
What is the difference between these 2 keywords?
marketposition[1]
marketposition(1)
Re: Help requested trying to track losing trades in a strate
I don't know... ... is there a place I can look that up? I am a rookie at this stuff but trying to learn.
I would think that marketposition[1] is either -1 (short trade) 0 (no trade) or 1 (long trade) one bar ago...
I am not familiar with the use of marketposition(1)
I would think that marketposition[1] is either -1 (short trade) 0 (no trade) or 1 (long trade) one bar ago...
I am not familiar with the use of marketposition(1)
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Help requested trying to track losing trades in a strate
see the first 2 postsI don't know... ... is there a place I can look that up? I am a rookie at this stuff but trying to learn.
I would think that marketposition[1] is either -1 (short trade) 0 (no trade) or 1 (long trade) one bar ago...
I am not familiar with the use of marketposition(1)
viewtopic.php?f=16&t=6929
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Help requested trying to track losing trades in a strate
Press [F1]I don't know... ... is there a place I can look that up? ...
most of the answers are there.