Forum

Indicator will not draw horizontal or trend lines until timeframe change

After applying a template of which the attached indicator is a part of, the indicator will not draw the horizontal or trend lines until I change timeframe. After a timeframe change, it works fine. Could someone be so kind as to help me understand what is going on and how to fix the issue. Regards

possible loss of data due to type conversion

I have written an indicator that copies trend and horizontal lines from one chart to another. It works ok. But, when I compile the code I get 8 warnings. I can't figure out how to eliminate the warnings. Any suggestions would be appreciated. Regards ----Tom

Which is the most efficient?

Which is the most efficient programing? Reading and "if" statement every tick or just setting the bool variable every tick? Kind Regards ---Tom if (rrPrinted) rrPrinted = false ; || rrPrinted = false ; Most efficient? // CALCULATE PERCENT OF PIPS RISK if ( EAOpenTrades() > 0 ) {

Calculating Maximum Lots

I have written an indicator to calculate your lot size and maximum lot size based of percent of account you are risking and stoploss distance. It works most of the time on most pairs. But, every so often I get an insufficient funds error even though I am using the calculated lot size based on risk

Closing all Pending Orders on new bar

Could someone tell me why the code below only closes one open trade per bar? e.g. I have two open orders. On each new bar ClosePending() is called. However, only one will close this bar and the second closes the next bar? Thanks in advance. //---------------------------Close Pending

Help with Text Indicator

Could someone kindly look at my code and tell me why I must refresh my screen in order to get my Lot_Size indicator to display? I do not have the same issue with any of my other text writing indicators and they all follow the same construction. The only difference is they are based of chart data and

Higher Time Frame Indicator

Can someone tell me if it is possible to add a 5 min MACD to a 1 min chart and have it look as if you where looking at it on the 5 min chart? By simply changing the timeframe to 5 with in the code yields the desired look on initialization and when I change to a higher timeframe chart and back to the

Sound and Email Notification

Could someone please help me with my notification code. The code is suppose to email when a trade is entered. During backtest the Print statement always has OrderCnt_0 = OrderCnt_1? Thanks in advance for the help. ---Tom ***Please See Updated Code below this one***** int OrderCnt_1 = 0 ;

If in trade return(0)

Please help. I am trying to stop my robot from entering two trades at once. Below is a simplified block diagram of what I am trying to accomplish, as well as the code I am using. The code doesn’t work. What am I doing wrong? Is it the use of a return (0) that is wrong? If so, why? Do I need to do

Entered Two Trades Today?

Why doesn't the following keep me from entering a trade twice (orders are below the attached code )? Thanks inadvance for your help // Is this EA currently in a trade for (i= 0 ;i< OrdersTotal ();i++) { OrderSelect (i,SELECT_BY_POS); if (OrderSymbol()== Symbol () &&