eddieTrader: However this is not working.
|
|
You should at least check the value returned from ObjectGetValueByShift. It may not be so important hre as you are checking for a bid value lower than the returned value
double my_trendline_value=ObjectGetValueByShift("my_trendline",0); if(my_trendline_value==0) Comment("Trend Line Not Found"); else if(Bid<=my_trendline_value && OrdersTotal()==0) { place_a_buy=place_Buy(1,1,100,1,150,3,1,1,1,""); }
We have no idea what place_Buy does
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 am learning about how to capture the value of a trendline and then use it as a trigger for a buy/sell order.
So I made a very very simple EA. I have this small piece of code to place a buy order.
The idea was that I would manually draw a line in a chart, change its name to "my_trendline" and I would move it very close to the price so that when the price goes equal or below this line, a buy order is placed.
Since I am interested in the current BID and the current value on the trendline I am using shift=0 in the ObjectGetValueByShift.
However this is not working.
Am I doing it in the propper way?