[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 440
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
Может так лучше будет
Thank you so much for your help!!!
America is weeping and so is Europe!
They're thinking seriously about the future!
They think they're in financial trouble,
♪ and Russia's in the... ♪ ...frosty!
Let's get the old harmonica off the shelf,
We're not used to this kind of crisis!
If only there were vodka, bacon and potatoes.
We'll get through it all, for fuck's sake!!!
HAPPY FEBRUARY 23 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Спасибо! Поправил в советнике на Ваш вариант. Вот допишу это чудо и выложу в Code Base как свое первое (более-менее) серьезное творение!=)) Система, по которой пишу советника называется Мутеки, только немного с моими дополнениями(по управлению позициями). Хорошо, что есть хотя бы индикатор, который построит все эти трендовые=)))
Только еще возник вопрос. Как открыть три позиции одновременно (или приблизительно по одной котировке)?Я делал следующим образом. Правильно ли, или есть другие способы? Отложенниками не получится=(( Маленькое расстояние иногда слишком:(
if(b1==0 && !IsTradeContextBusy())
{
if(Low[0]<HHL_1 && Bid>=HHL_1 && trade_buy==true)
{
ticket=OrderSend(Symbol(),OP_BUY,lot,Ask,slippage*PointX,sl_b,BuyTarget1,"lot_1_buy",Magic,0,Lime);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("lot_1_buy order opened : ",OrderOpenPrice());
b1=1;
}
else Print("Error opening BUY order : ",GetLastError());
return(0);
}
}
You are opening one order here. Try 3 at once, it's unlikely to get faster at this stage.
I haven't experimented myself, but maybe if you parallelize 3 trading terminals and open deals in each terminal separately, you might get something out of it...
Код вроде бы такой должен быть... но не проверял...
there was an error, it showed that the lot always turns out to be 0.
to Necron:
found an error in the code and cleaned it up, but still it swears like this:
to Techno:
(double)
This is how it is done in one of my advisers:
double lt = getLots();//эта строчка в переменных, в ордерсенд пишем lt,
double getLots() { // это или перед start или после всего кода
double minlot = MarketInfo(Symbol(), MODE_MINLOT);
double maxlot = MarketInfo(Symbol(), MODE_MAXLOT);
int round;
if(minlot==0.01)round=2;
if(minlot==0.1) round=1;
double koeff=2;
double result=Lots;
//int round = 2;
int total = OrdersHistoryTotal();
double spread = MarketInfo(Symbol(), MODE_SPREAD);
for (int i = 0; i < total; i++) {
OrderSelect(i, SELECT_BY_POS, MODE_HISTORY);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magic) {
if (OrderProfit() > 0) {
result = Lots;
} else {
result = OrderLots() * koeff;
}
}
}
result = NormalizeDouble(result, round);
if (result > maxlot) {
result = maxlot;
}
if (result < minlot) {
result = minlot;
}
RefreshRates();
return(result);
}
Techno, thanks for the tip!) StatBars and Necron thanks too.
But to make sure the martingale would work, I reworked the code a bit))
здесь Вы один ордер открываете. попробуйте сразу 3, быстрее наврятли получиться на данном этапе.
Сам не экспериментировал, но, возможно, если запараллелить 3 торговых терминала и открывать сделки на каждом терминале в отдельности то может и получиться что-то выгадать...
I understand, I have 6 of them=) Three to buy and three to sell.I'll try to check on the demo later. At the very least I will try to do something with pending orders.
ошибка была, через алерт вывел, показало что лот всегда получается 0.