Do that, and blow your account. But if you insist, make sure you don't get a margin call (stop out.)
- You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
- Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip)
- Do NOT use TickValue by itself - DeltaPerLot
- You must normalize lots
properly and check against min and max.
- You must also check FreeMargin to avoid stop out
whroeder1:
Do that, and blow your account. But if you insist, make sure you don't get a margin call (stop out.)
thank you for the response . I know nothing about coding , would I literally just copy and paste this Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot
instead of writing extern double Lots =100;
OrderSend(...,MarketInfo(Symbol(),MODE_MAXLOT),...);
tennisplayer128: . I know nothing about coding , would I literally just copy and paste
this Account Balance * percent/100 = RISK = OrderLots *
(|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot
|
|
eevviill14:
thank you for the response . where in my code would I copy and paste this ?
OrderSend(...,MarketInfo(Symbol(),MODE_MAXLOT),...);
tennisplayer128:
thank you for the response . where in my code would I copy and paste this ?
In OrderSend()
thank you for the response . where in my code would I copy and paste this ?
eevviill14:
In OrderSend()
thank you again . so I just simply copy and paste that simple line of code wherever it says OrderSend and that's all I have to do ? should I delete this line of code extern double Lots =100; from the top as well ?
In OrderSend()
tennisplayer128:
thank you again . so I just simply copy and paste that simple line of code wherever it says OrderSend and that's all I have to do ? should I delete this line of code extern double Lots =100; from the top as well ?
thank you again . so I just simply copy and paste that simple line of code wherever it says OrderSend and that's all I have to do ? should I delete this line of code extern double Lots =100; from the top as well ?
yes
if you want EA to open max lots
you need to set MarketInfo(Symbol(),MODE_MAXLOT) in OrderSend function in places where lot must be.
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, im trying to code a basic expert advisor . at the top of my code I have written extern double Lots =100;
so that sets the amount of lots my expert advisor trades with to 100 lots . I want to change this. my question is , how can I code my expert advisor to trade the maximum amount of lots possible on every trade ?
instead of writing extern double Lots =100; what would I write instead of that ? thank you