Multiple orders and 1st tick only trade

To add comments, please log in or register
Gabriel Brasil
149
Gabriel Brasil  

Hi there guys!

I just made a little EA to test a strategy here but my knowledge of programming goes only so far and there are a few problems I want to solve and hoped you guys could help me out here:

1) The ea needs to open a trade right at the open of a new candle, if the rules are met on the previous. Its doing that all right, but if the TP is hit in that same candle, it will open more trades and that`s not good, so I need the EA to trade only at the openning of the candle, not when the candle has already moved. (so I think I need something like a "trade only on the first tick" command or something).

2) I need the ea to open a trade every time a new signal is given despite i have orders already opened. Right now, it opens one trade and until that trade is closed it will not trade any new signals.

I hope you guys can help me out. I would need that someone told me where I should place these new command lines also, cuz I won`t have any idea.

Thank you very much!

Keith Watford
Moderator
24162
Keith Watford  

You can loop through OrdersHistory and OpenOrders and see if OrderOpenTime >Time[0]

If it is true, then you will know that a trade has already been opened in that bar, so don't open another.

Gabriel Brasil
149
Gabriel Brasil  
GumRai, I haven`t find "OrderOpenTime" in the script... could you help?
Files:
robo.txt 5 kb
Gabriel Brasil
149
Gabriel Brasil  
Up!
William Roeder
22323
William Roeder  
gbraidotti: GumRai, I haven`t find "OrderOpenTime" in the script... could you help?
learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
To add comments, please log in or register