Help please

Questions about MultiCharts and user contributed studies.
andrea71
Posts: 3
Joined: 17 Sep 2012
Has thanked: 1 time

Help please

Postby andrea71 » 17 Sep 2012

Hi falks,
i need some help please.
I am trying to build a strategy using parabolic sar ( don’t lought I know it’s hard ) but I am encountering a problem. I am not able to make the system recognize the last position. For example if the system goes long and the position enter long how can I tell the system to do not enter any other order short until the current position its been close either in stop or at target ?

Thank you in advance to anyone it will halp me
Andrea

User avatar
Henry MultiСharts
Posts: 8448
Joined: 25 Aug 2011
Has thanked: 1207 times
Been thanked: 2705 times

Re: Help please

Postby Henry MultiСharts » 18 Sep 2012

Hello Andrea71,

MarketPosition returns a numerical value, indicating the type of the specified position (open position, one/two positions back, etc.).

A value of 1 indicates a long position, -1 indicates a short position, and 0 is returned only if the current position is specified and indicates that the current position is flat.

andrea71
Posts: 3
Joined: 17 Sep 2012
Has thanked: 1 time

Re: Help please

Postby andrea71 » 18 Sep 2012

Hi Henry, first of all thank you for your help
due to your answer does this make sense for you?

thank you in advance
andrea
Attachments
codex.jpg
codex.jpg (111.07 KiB) Viewed 169 times

User avatar
Henry MultiСharts
Posts: 8448
Joined: 25 Aug 2011
Has thanked: 1207 times
Been thanked: 2705 times

Re: Help please

Postby Henry MultiСharts » 18 Sep 2012

The code looks ok. Does it work as expected?
These users thanked the author Henry MultiСharts for the post:
andrea71

andrea71
Posts: 3
Joined: 17 Sep 2012
Has thanked: 1 time

Re: Help please

Postby andrea71 » 18 Sep 2012

hi Henry, unfortunately not :(
in the backtest it still missing trades that he should have done without problems like many others that are oki :( and the missed are many :( any suggestions ?

thank you in advance
andrea
Attachments
trades.jpg
trades.jpg (112.94 KiB) Viewed 149 times

User avatar
Henry MultiСharts
Posts: 8448
Joined: 25 Aug 2011
Has thanked: 1207 times
Been thanked: 2705 times

Re: Help please

Postby Henry MultiСharts » 19 Sep 2012

andrea71 wrote:hi Henry, unfortunately not :(
in the backtest it still missing trades that he should have done without problems like many others that are oki :( and the missed are many :( any suggestions ?
thank you in advance
andrea

Hello Andrea,

I would recommed you to check this article and use Print statement to debug your code.


Return to “MultiCharts”