Indicator inside the Signal problem  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
Sylpha
Posts: 29
Joined: 14 Apr 2015
Has thanked: 1 time

Indicator inside the Signal problem

Postby Sylpha » 25 Jun 2015

I have tried to use my custom indicator inside a signal but the order generated are all wrong.

The screen is showing a messy order entry and exit, but if you read the code, it shouldn't generate so many orders. Any clue about this??

I have displayed the two MAs on the charts, it should not be possible to buy when the slow MA is failing.
Attachments
2015-06-25 15_49_25-MultiCharts .NET64 - Untitled Desktop - Chart - [HSI_CC - 1 Day - Interactive Br.png
(32.22 KiB) Downloaded 820 times
Last edited by Sylpha on 25 Jun 2015, edited 1 time in total.

Sylpha
Posts: 29
Joined: 14 Apr 2015
Has thanked: 1 time

Re: Indicator inside the Signal problem

Postby Sylpha » 25 Jun 2015

attached the workspace, signal and indicator
Attachments
export2.rar
(18.56 KiB) Downloaded 243 times

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Indicator inside the Signal problem

Postby Dave Masalov » 25 Jun 2015

Hello,

The following indicator is needed to compile your code: Jeffrey_ATR_v2

Please send us the indicator above so we can help you.

Sylpha
Posts: 29
Joined: 14 Apr 2015
Has thanked: 1 time

Re: Indicator inside the Signal problem

Postby Sylpha » 25 Jun 2015

Attached. Thanks a lot.
Attachments
tmp_20637-Jeffrey_ATR_V217626470.pln
(2.4 KiB) Downloaded 567 times

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Indicator inside the Signal problem  [SOLVED]

Postby Henry MultiСharts » 29 Jun 2015

Hello Sylpha,

You need to move the following code from Create() to StartCalc():

Code: Select all

atr.Mode=3;
atr.Period=FastPeriod;
slowHMA.Period=SlowPeriod;
fastHMA.Period=FastPeriod;
In Create you create only. Setup is done in StartCalc.


Return to “MultiCharts .NET”