⋮ <window> height=282 fixed_height=0 <indicator> name=main <object> type=23 object_name=BarTimer ⋮ </object> ⋮
The objects are also part of the template. Edit it and remove them.
I always delete all objects before I save a template. As you can see there are no objects listed. ---Tom
<chart> id=133083287163227739 symbol=CHFJPY period=5 leftpos=4354 digits=3 scale=8 graph=1 fore=0 grid=0 volume=0 scroll=1 shift=1 ohlc=1 one_click=0 one_click_btn=1 askline=1 days=0 descriptions=0 shift_size=13 fixed_pos=0 window_left=156 window_top=156 window_right=1816 window_bottom=727 window_type=3 background_color=0 foreground_color=16777215 barup_color=65280 bardown_color=255 bullcandle_color=25600 bearcandle_color=128 chartline_color=65280 volumes_color=3329330 grid_color=255 askline_color=3329330 stops_color=255 <window> height=375 fixed_height=0 <indicator> name=main </indicator> <indicator> name=Custom Indicator <expert> name=ALERT - PRICE flags=339 window_num=0 <inputs> xxxxxxxxxxxx=*********** Line Properties *********************************** UpperColor=9408444 LowerColor=9408444 LineWidth=1 xxxxxxxxxxx=*********** Object Locations *********************************** PriceWindow=0 PriceCorner=3 PriceText=PA PriceText_XDISTANCE=160 PriceText_YDISTANCE=37 PriceHLS_YDISTANCE=55 PriceHLS_XDISTANCE=150 PriceTLS_XDISTANCE=100 PriceCLR_XDISTANCE=51 PriceAlert_YDISTANCE=32 PriceAlert_XDISTANCE=150 PricePush_XDISTANCE=75 </inputs> </expert> shift_0=0 draw_0=0 color_0=0 style_0=0 weight_0=0 period_flags=0 show_data=1 </indicator> </window> </chart>
The objects are also part of the template. Edit it and remove them, and reapply.
I finally figured out how to fix issue. Although topPrice and bottomPrice are in the int OnInit(), they had a value of zero until I changed periods/timeframe (I don't understand why?). By moving the equations to the OnChartEvent, it now works properly. Thanks for your earlier suggestion. Kind Regards ---Tom
don't try to use any price (or indicator) or server related functions in OnInit (or on load or in OnTimer before you've received a tick), as there may be no connection/chart yet:
- Terminal starts.
- Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
- OnInit is called.
- For indicators OnCalculate is called with any existing history.
- Human may have to enter password, connection to server begins.
- New history is received, OnCalculate called again.
- A new tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.
don't try to use any price (or indicator) or server related functions in OnInit (or on load or in OnTimer before you've received a tick), as there may be no connection/chart yet:
- Terminal starts.
- Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
- OnInit is called.
- For indicators OnCalculate is called with any existing history.
- Human may have to enter password, connection to server begins.
- New history is received, OnCalculate called again.
- A new tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.
I will add this to my notes. Good to know. Thanks ----Tom
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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 ----Tom