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.
Indicator inside the Signal problem [SOLVED]
Indicator inside the Signal problem
- 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.
Re: Indicator inside the Signal problem
attached the workspace, signal and indicator
- Attachments
-
- export2.rar
- (18.56 KiB) Downloaded 251 times
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: Indicator inside the Signal problem
Hello,
The following indicator is needed to compile your code: Jeffrey_ATR_v2
Please send us the indicator above so we can help you.
The following indicator is needed to compile your code: Jeffrey_ATR_v2
Please send us the indicator above so we can help you.
Re: Indicator inside the Signal problem
Attached. Thanks a lot.
- Attachments
-
- tmp_20637-Jeffrey_ATR_V217626470.pln
- (2.4 KiB) Downloaded 571 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Indicator inside the Signal problem [SOLVED]
Hello Sylpha,
You need to move the following code from Create() to StartCalc():In Create you create only. Setup is done in StartCalc.
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;