Forum

Switch-case statement issue...

I'm writing an indicator with a switch-case statement and it's behaving in a way that I can't understand. I'm wondering if someone might have some insight? This switch-case runs a state machine. Once in the upwardTrend or downwardTrend state, it should only be able to go back to the noTrend state if

Problem in OnCalculate()

Wondering if someone can shed some light on an issue I'm having in my OnCalculate() function. I'm trying to do three iterations of calculations when the function gets called, but I can't seem to get anything to happen in the third iteration. Everything works fine in the first two iterations, but if

Indicator signal won't draw

I'm coding a volume-based custom indicator with two signals and for some reason that I just can't figure out the second line won't draw. The name of the buffer that won't draw is relVolumeMA in the code below. I'm not a programming expert by any stretch, but have done quite a few indicators and I'm

Indicator behaves differently in tester

I've make a custom indicator, and for some reason the output is different when I am using it in the strategy tester than it is when I just drop it onto a chart. I'm attaching a screenshot showing the indicator twice in the same window. The top one is what I got when using the strategy tester (visual

Indicator lines don't update in backtester

I'm having an issue where I've written an indicator and am now using it to backtest a strategy. I start my backtester in visual mode and then drop my indicator onto the chart. When I do that, the lines in the indicator don't ever update from that point forward, they just stay at the same value, even

Multiple Timeframe ADX Indicator

I am trying to put together an indicator that would show the signal line from the ADX indicator from the next three higher timeframes all on one indicator, the only variation being that if -DI is above +DI it will show as a negative value. I've got three lines displaying on the indicator, but they

Using indicators in a new indicator???

I am trying to write an indicator that uses information from the ADX indicator and am trying to pull data from the ADX indicator the same way I do in my EA's, as follows: ADX_Signal[i] = iADX(NULL, 0, 14, PRICE_CLOSE, MODE_MAIN, i); // ADX Signal Line However, this doesn't seem to work when used in

Global Variable Scope

I've been using the GlobalVariable....() functions to create my global variables for my EA but am wondering if I'm making life too difficult for myself. I will be running this EA on multiple charts in the same terminal at the same time and have been using the GlobalVariable...() functions to avoid

Create an array of structs

I am trying to create an array of structs, everything I find online indicates there shouldn't be a problem with that, but I can't seem to get my code to compile when I try to do this. Here is what I am trying to do: // Heiken Ashi Candle Struct int ha = 20 ; // Make this number at least 5 more

How to use heiken ashi candles???

I'd like to write an EA that looks at heiken ashi candles instead of normal candles but am not sure how to do that (I'm still pretty new at this). Do I just write a standard EA using the Open[], High[], Low[], Close[] commands and drop it on a chart showing heiken ashi candles? Or is there some