HI,
I've got an autotrade program I'm trying to improve by adding candlesticks.
Doji candlestick patterns work fine - no issues. But when I use any pattern that has an Output Variable return, I get an error message. Even if it's exactly copy and pasted from the TS Functions and Reserve Words pdf.
Ex 1:
Value1 = C_BullEng_BearEng(14, oBullishEngulfing, oBearishEngulfing) ;
Error Msg with 'oBearishEngulfing' Highlighted in blue:
------ Compiled with error(s): ------
is not recognized
line 1, column 50
Ex 2:
Value1 = C_Hammer_HangingMan(14, 2, oHammer, oHangingMan) ;
Error Msg with 'oHammer' highlighted in blue:
------ Compiled with error(s): ------
is not recognized
line 1, column 36
I'm using MC64 for TWS.
Any ideas? or Recommendations?
Thanks in advance,
Jason
Problems with Candlesticks with Output Variable Returns [SOLVED]
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Problems with Candlesticks with Output Variable Returns
You have to post more codes to make it sensible.HI,
I've got an autotrade program I'm trying to improve by adding candlesticks.
Doji candlestick patterns work fine - no issues. But when I use any pattern that has an Output Variable return, I get an error message. Even if it's exactly copy and pasted from the TS Functions and Reserve Words pdf.
Ex 1:
Value1 = C_BullEng_BearEng(14, oBullishEngulfing, oBearishEngulfing) ;
Error Msg with 'oBearishEngulfing' Highlighted in blue:
------ Compiled with error(s): ------
is not recognized
line 1, column 50
Ex 2:
Value1 = C_Hammer_HangingMan(14, 2, oHammer, oHangingMan) ;
Error Msg with 'oHammer' highlighted in blue:
------ Compiled with error(s): ------
is not recognized
line 1, column 36
I'm using MC64 for TWS.
Any ideas? or Recommendations?
Thanks in advance,
Jason
Have you defined your variables?
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Problems with Candlesticks with Output Variable Returns [SOLVED]
It works fine here after defining the variables:I've got an autotrade program I'm trying to improve by adding candlesticks.
Doji candlestick patterns work fine - no issues. But when I use any pattern that has an Output Variable return, I get an error message. Even if it's exactly copy and pasted from the TS Functions and Reserve Words pdf.
(...)
Any ideas? or Recommendations?
Code: Select all
Variables:
oBullishEngulfing(0),
oBearishEngulfing(0),
oHammer(0),
oHangingMan(0);
Value1 = C_BullEng_BearEng(14, oBullishEngulfing, oBearishEngulfing);
Value2 = C_Hammer_HangingMan(14, 2, oHammer, oHangingMan);
That `NumericSimpleRef` means these variables are passed as reference into the function (see here for more for what that means).
In other words, a variable needs to be provided to the candlestick function so that it can store a value into that variable (as a way of outputting data from the function). Without such variable, there's an error when compiling.
- Attachments
-
- scr.02-05-2015 17.27.29.png
- (3.73 KiB) Downloaded 684 times
Re: Problems with Candlesticks with Output Variable Returns
JoshM you nailed it. That was it. Thank you, I just spent the past 4.5 hrs improving my strategy. Thank you very much.
I figured since I didn't have to declare the doji or shooting star as a variable, I could just do the same with Output Variable Returns, clearly there's still a lot to learn
Thanks,
Jason
I figured since I didn't have to declare the doji or shooting star as a variable, I could just do the same with Output Variable Returns, clearly there's still a lot to learn
Thanks,
Jason