So technically, in your new bar code, you get the price of the object(s), compare that to the last candle close price, and open an order if it closed above.
Show us your attempt (using the CODE button) and state the nature of your difficulty.
No free help (2017)
William Roeder #:
So technically, in your new bar code, you get the price of the object(s), compare that to the last candle close price, and open an order if it closed above.
Show us your attempt (using the CODE button) and state the nature of your difficulty.
No free help (2017)
//As far as i got for a sketch this is it string name; double price; for(int i =ObjectsTotal(0,0,OBJ_HLINE)-1; i>=0; i--) { name = ObjectName(0,i); price = ObjectGetDouble(0,name,OBJPROP_PRICE1); if(iClose(NULL,PERIOD_CURRENT,0)< price){ Alert("SELL"); }else{ Alert("Buy"); } }
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
So technically i want to open a trade once a candlestick has closed above the Hline or aleast find a hline that is near the closed and open a trade base on if its above or below.
How would i write this in code?