It would help if u show your code... (and please use the SRC button).
Hi Gordon,
Sorry for the delay. Enclosed is the indicator.
I modified the code with two changes: I added the "testState" extern variable and a print statement to show the extern variable states. It is best to disconnect from a live feed for this test. To reproduce the problem, do as follows:
- Create a new chart and add the attached indicator.
- Change the indicators TimeFrame variable from 0 to 60.
- Switch to the M30 view.
- Start terminal and select the Experts tab.
- Note the initialized outputs for the M30 and H1 view. For this test, only concentrate on the last 2 digits.
- It will show "xxxx10" where the "1" is for the "alertsAfterBarClose" variable and 0 for the "testState" variable. The " - 60" is the "TimeFrame" variable of the indicator and not the view timeframe.
- The outputs for both view timeframes will be the same.
- Now change the "testState" state to true.
- Note how they are NOT the same for both views (i.e., M30 and H1)
- Now change the "alertsAfterBarClose" to false.
- Note how they ARE the same for both views (as they should be).
- Why does it work properly with one variable but not the other?
Am I missing something?
Thanks for any help you can provide.
--Lenard
Files:
lenardd:
When TF <> Period() it executes- Why does it work properly with one variable but not the other?
sslHup[i] = iCustom(NULL,TimeFrame,IndicatorFileName,Lb,sslMA_method,SSL_BarLevel,alertsOn,alertsMessageBox, alertsSound,alertsSoundFile,alertsEmail,alertsAfterBarClose,0,y);Which does not have all the externals
extern bool alertsAfterBarClose = true; extern bool testState = false; extern int TimeFrame = 0; extern string TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN|0-CurrentTF"; extern string MA_method_ = "SMA0 EMA1 SMMA2 LWMA3";
WHRoeader,
Thanks for pointing it out.
I knew it was going to be something really silly. :)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I have an existing indicator where I added a new bool extern variable. For some reason when I change it when the indicator is running, the code still thinks it is the default value of when it was declared. There is nothing in my code that changes the variable state. I am only reading it. Also, if I change the default value that was first declared, then that value is used when the indicator runs regardless of what the user had selected and saved with the template.
Has anyone run across this before?
Thanks for any help.
--Lenard