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
OrderComment can be overwritten by your broker
you are wanting... Now, as per my requirement, when the price would be say 7 pip [103.603] in profit, the Stop Loss of
1st and 2nd trade will become say 1 pip profit [103.543] and 3rd trade's Stop Loss will remain at 103.386.
make extern int BreakEven = 7
(* 10 ) correction at 5 digit broker to get pipvalue
ohh, Yes, this is certainly a Shortcoming. All my hard work since evening gone into vain now!
Tried a way to distinguish the trades depending on 'order comment' function and wrote a code.
Anyway, your given code will do the moving of Stop Loss part to BE or at desired point but still my problem with the 'Third' trade isn't solving.
I have also this BE moving part of code but I got stuck with the Non-moving SL for third trade.
Just got another idea, trying it now.
And was this Valid?
string comment_sell="Sell Order";
SellOrder=OrderSend(Symbol(), iOrderType_Sell, LotSize,OpenPrice,Slippage,dStopLossPrice,dTakeProfitPrice, comment_sell ,MagicNumber, 0,Red);
if (OrderComment()=="comment_sell") // ?
Is this Valid?
Say I have attached the EA to EURUSD chart.
if (Order_Symbol()==EURUSD)
Will it compare whether the current chart is of EURUSD or not?
Here is a way of distinguishing orders via 'Magic Number' I though.
Braces are not Balanced.
Is this Possible?
this way you have to look for 3 different magicnumbers
it looks to me possible to do
Ok, after a Continuous Hard Working Spell (at least for me), made the EA 'Error Free'!
Posting the changes in short:
I have confusion with Set_Magic_Number() function.
Have I defined it correctly? Also while calling it in other functions, will it work correctly?
Regards
I have confusion with Set_Magic_Number() function.
Have I defined it correctly? Also while calling it in other functions, will it work correctly?
Regards
i read here your symbol is not "EURUSD"
you have to use the right symbol
i read here your symbol is not "EURUSD"
you have to use the right symbol
It's not a problem. The symbol of the broker where I'm testing the EA is EURUSD,GBPUSD....
If I attach the EA to broker where the symbol is EURUSDpro, I'll just add the 'pro'.
Have you reviewed my code?
The minimum profit feature is a 'Failure'.
It's just closing all open trades whenever it's getting executed irrespective of Loss/Profit in the trades!
But my aim is not like this.
I want that if a trade goes into profit zone and then the market starts to turn back, this 'Minimum Profit' feature will ensure
that trade got closed with my desired minimum profit.
And here also I don't want that 'Third' trade to be affected by this feature.
I tried to write something like that but now it's not working.
It's not a problem. The symbol of the broker where I'm testing the EA is EURUSD,GBPUSD....
If I attach the EA to broker where the symbol is EURUSDpro, I'll just add the 'pro'.
Have you reviewed my code?
The minimum profit feature is a 'Failure'.
It's just closing all open trades whenever it's getting executed irrespective of Loss/Profit in the trades!
But my aim is not like this.
I want that if a trade goes into profit zone and then the market starts to turn back, this 'Minimum Profit' feature will ensure
that trade got closed with my desired minimum profit.
And here also I don't want that 'Third' trade to be affected by this feature.
I tried to write something like that but now it's not working.
You make it far too complex because you have no idea how to handle this
the more you read and try to program yourself the easier it becomes to make more complex things
but start with simple things if you start to make a program work for one trade then later you try with more trades
you have to learn a lot.
if you start picking a short simple written program and do some changes on that for testing
you might learn how that program is working
Your problem you started
See how i would do it
not needed different inputs for Symbol()
3 different Magicnumbers..
It's not a problem. The symbol of the broker where I'm testing the EA is EURUSD,GBPUSD....
If I attach the EA to broker where the symbol is EURUSDpro, I'll just add the 'pro'.
Have you reviewed my code?
The minimum profit feature is a 'Failure'.
It's just closing all open trades whenever it's getting executed irrespective of Loss/Profit in the trades!
But my aim is not like this.
I want that if a trade goes into profit zone and then the market starts to turn back, this 'Minimum Profit' feature will ensure
that trade got closed with my desired minimum profit.
And here also I don't want that 'Third' trade to be affected by this feature.
I tried to write something like that but now it's not working.
I compiled your code 80 errors 6 warnings
mostly undeclared identifier
i need the code yours with all identifier declared
if the file is too big then attach
compile the file and check the errors you get