QuoteDislikedvoid OnTick()
{
check();
last = (Ask-Bid) *MathPow(10,Digits);
if (last > max) max = last;
if (last < min) min = last;
ct++;
tot = tot + last;
aver = tot / ct;
string text = StringConcatenate("Time |", TimeToStr(ltime,TIME_SECONDS), "| last |", last, "| max |", max, "| min |", min, "| aver |", aver, "| ct |", ct, " last2 ", last2, " aver2 ", aver2, " lastT ", last+last2, " averT ", aver+aver2, "\n" );
string text2 = StringConcatenate("** obj ", obj," acuret ",CalculAcu(), " acutot ", acutot," OrderProfit() ",OrderProfit()," nLots ", OrderLots(), " acuLots ", acuLots," UnitP ", UnitP, " MN ", MagicNumber, "\n ", " OrderOpenPrice ", OrderOpenPrice(), " Top y Bottom ",TopEntry, " ", BottomEntry, " cmdN ", cmdN, " canalRx ", canalRx, " strRx ", strRx);
Comment(text2);
SendCmd(canalTx, OP_SPREAD, cmdN+1, text);
strRx = ReceiveCmd(canalRx);
string result = StringSplit(strRx,"|", 1);
if (StringToInteger(result) < 99)
doCommand(strRx);
if(Time[0] != ltime)
{
Print(text);
ltime = Time[0];
tot = 0;
ct = 0;
max = 0;
min = 99999;
}
}
I’m sending messages thru QuickChannel between robots running on different brokers.
The robot on each broker is the same with different channels: A for sending-receiving, B for receiving-sending.
It works fine; all messages sent from robot 1 are received by robot2 and vice versa.
So far, so good...
My robot is supposed to run just on new ticks coming; nevertheless it runs continuously, throwing thousands of messages per minute!!
Anyone knows how can I have the messages sent just when a new tick arrives from one side or another?
Regards
INtrader