The New Beast!

Locked
snoopier
Posts: 2
Joined: Sun Feb 12, 2012 8:12 pm

Re: The New Beast!

Post by snoopier »

Hi,

i modified the balance function for myself to get only one currency in one direction
like eurusd long and usdchf long is allowed
The original code doesnt work properly

Best Regards
Dennis


>>>>>>>>>>>>>>>>>>>>>
bool BalancedPair(int type)
{
if (IsTesting()) return (true);

string BuyCcy1, SellCcy1, BuyCcy2, SellCcy2, sType1, sType2;

if (type == OP_BUY || type == OP_BUYSTOP)
{
sType1 = "Buy";
BuyCcy1 = first.currency;
SellCcy1 = second.currency;
}//if (type == OP_BUY || type == OP_BUYSTOP)
else
{
sType1 = "Sell";
BuyCcy1 = second.currency;
SellCcy1 = first.currency;
}//else

for (int cc = OrdersTotal() - 1; cc >= 0; cc--)
{
if (!OrderSelect(cc, SELECT_BY_POS)) continue;
if (OrderSymbol() == symbol) continue;
if (OrderType() == OP_BUY || OrderType() == OP_BUYSTOP)
{
sType2 = "Buy";
BuyCcy2 = StringSubstr(OrderSymbol(), 0, 3);
SellCcy2 = StringSubstr(OrderSymbol(), 3, 3);
}//if (OrderType() == OP_BUY || OrderType() == OP_BUYSTOP)
else
{
sType2 = "Sell";
BuyCcy2 = StringSubstr(OrderSymbol(), 3, 3);
SellCcy2 = StringSubstr(OrderSymbol(), 0, 3);
}//else

if ( (BuyCcy1 == BuyCcy2) || (SellCcy1 == SellCcy2) )
{
//Print("BalancedPair checks ", symbol, "(", sType1, ") -> blocked by ", OrderSymbol(), "(", sType2, ")");
//last.balance.block.time = TimeCurrent();
//last.balance.block.curr = OrderSymbol()+"-"+sType2;
//last.balance.block.type = sType1;
return(false);
}
}//for (int cc = OrdersTotal() - 1; cc >= 0; cc--)

//Got this far, so it is ok to send the trade
return(true);

}//End bool BalancedPair(int type)
>>>>>>>>>>>>>>>>>>>>>
Image
User avatar
Pippopotamus
Trader
Posts: 70
Joined: Wed Nov 16, 2011 2:32 pm
Location: NY/NJ Metro Area

Re: The New Beast!

Post by Pippopotamus »

snoopier wrote:Hi,

i modified the balance function for myself to get only one currency in one direction
like eurusd long and usdchf long is allowed
The original code doesnt work properly

Best Regards
Dennis


>>>>>>>>>>>>>>>>>>>>>
bool BalancedPair(int type)
{
if (IsTesting()) return (true);

string BuyCcy1, SellCcy1, BuyCcy2, SellCcy2, sType1, sType2;

if (type == OP_BUY || type == OP_BUYSTOP)
{
sType1 = "Buy";
BuyCcy1 = first.currency;
SellCcy1 = second.currency;
}//if (type == OP_BUY || type == OP_BUYSTOP)
else
{
sType1 = "Sell";
BuyCcy1 = second.currency;
SellCcy1 = first.currency;
}//else

for (int cc = OrdersTotal() - 1; cc >= 0; cc--)
{
if (!OrderSelect(cc, SELECT_BY_POS)) continue;
if (OrderSymbol() == symbol) continue;
if (OrderType() == OP_BUY || OrderType() == OP_BUYSTOP)
{
sType2 = "Buy";
BuyCcy2 = StringSubstr(OrderSymbol(), 0, 3);
SellCcy2 = StringSubstr(OrderSymbol(), 3, 3);
}//if (OrderType() == OP_BUY || OrderType() == OP_BUYSTOP)
else
{
sType2 = "Sell";
BuyCcy2 = StringSubstr(OrderSymbol(), 3, 3);
SellCcy2 = StringSubstr(OrderSymbol(), 0, 3);
}//else

if ( (BuyCcy1 == BuyCcy2) || (SellCcy1 == SellCcy2) )
{
//Print("BalancedPair checks ", symbol, "(", sType1, ") -> blocked by ", OrderSymbol(), "(", sType2, ")");
//last.balance.block.time = TimeCurrent();
//last.balance.block.curr = OrderSymbol()+"-"+sType2;
//last.balance.block.type = sType1;
return(false);
}
}//for (int cc = OrdersTotal() - 1; cc >= 0; cc--)

//Got this far, so it is ok to send the trade
return(true);

}//End bool BalancedPair(int type)
>>>>>>>>>>>>>>>>>>>>>
Many, many thanks Dennis. Will test. FWIW, my set file, and pair selections on request...Pippo
Last edited by Pippopotamus on Mon Dec 10, 2012 11:17 am, edited 1 time in total.
Trading is Art
User avatar
cuzgeorge
Trader
Posts: 674
Joined: Mon Mar 05, 2012 10:10 am
Location: Johannesburg, South Africa.

Re: The New Beast!

Post by cuzgeorge »

Hi Pippo, Snoopier,

i am a little baffled how to get this done. I cant find anything in the simple beast similar to the snippet so i can make the changes.
I find something along these lines in slopey Beast, but obviously, i think this is meant for Simple Beast, right?. Help, please.
TIA and MIA for now :lol: ,
cuz
10.X, BMac,Xmeter,Marylin,and CaptsNakedTrading thread coupled with Slowkeys Intraday setup for manual trades.
http://www.stevehopwoodforex.com/phpBB3 ... f=36&t=848
User avatar
Pippopotamus
Trader
Posts: 70
Joined: Wed Nov 16, 2011 2:32 pm
Location: NY/NJ Metro Area

Re: The New Beast!

Post by Pippopotamus »

George, wish I could help, but I'm not a good coder. I must fiddle around with this until I get it to work... a tatons, comme toujours...
Trading is Art
User avatar
cuzgeorge
Trader
Posts: 674
Joined: Mon Mar 05, 2012 10:10 am
Location: Johannesburg, South Africa.

Re: The New Beast!

Post by cuzgeorge »

Pippopotamus wrote:George, wish I could help, but I'm not a good coder. I must fiddle around with this until I get it to work... a tatons, comme toujours...
Thanks Pippo,
i'll keep trying. Something should 'Click' in my brain eventually. :lol: :lol:
regards and stay well.
cuz
10.X, BMac,Xmeter,Marylin,and CaptsNakedTrading thread coupled with Slowkeys Intraday setup for manual trades.
http://www.stevehopwoodforex.com/phpBB3 ... f=36&t=848
jlcgarcia

Re: The New Beast!

Post by jlcgarcia »

Hi,

I have replaced the old balanced pair function with the new posted by snoopier.


Please check if it functions correctly.
Simple Beast! with new balanced pair.mq4


Regards



José Luis
You do not have the required permissions to view the files attached to this post.
Last edited by jlcgarcia on Tue Dec 11, 2012 5:27 pm, edited 2 times in total.
User avatar
cuzgeorge
Trader
Posts: 674
Joined: Mon Mar 05, 2012 10:10 am
Location: Johannesburg, South Africa.

Re: The New Beast!

Post by cuzgeorge »

Garcia to the rescue,!!!!!!!!!!!!
i knew we could count on you,
kind regards,
cuz
10.X, BMac,Xmeter,Marylin,and CaptsNakedTrading thread coupled with Slowkeys Intraday setup for manual trades.
http://www.stevehopwoodforex.com/phpBB3 ... f=36&t=848
User avatar
Pippopotamus
Trader
Posts: 70
Joined: Wed Nov 16, 2011 2:32 pm
Location: NY/NJ Metro Area

Re: The New Beast!

Post by Pippopotamus »

jlcgarcia wrote:Hi,

I have replaced the old balanced pair function with the new posted by snoopier.


Please check if it functions correctly.
Simple Beast! with new balanced pair.mq4


Regards



José Luis
Muy amable de usted Jose Luis, muchisimas gracias...
Trading is Art
User avatar
Pippopotamus
Trader
Posts: 70
Joined: Wed Nov 16, 2011 2:32 pm
Location: NY/NJ Metro Area

Re: The New Beast!

Post by Pippopotamus »

I have Simple Beast on 15 pairs. Looks like Snoopier, and Jose Luis have done great work. Again, thank you both. Currently have 2, "related," pairs in play, Sell xxx/Usd, and Sell Usd/xxx. Will now be monitoring recovery processes. George, what have you seen so far?
Trading is Art
User avatar
cuzgeorge
Trader
Posts: 674
Joined: Mon Mar 05, 2012 10:10 am
Location: Johannesburg, South Africa.

Re: The New Beast!

Post by cuzgeorge »

Pippo,
i have set up and not had a trade yet, 12 pairs, based on minimum spread from my crim.

I'm using a combination of a set file i picked up from JL a long time ago for this, and i changed the recovery to 1,1,2,4. cant remember what else right now. Will post that also on fxpage.

I also have'nt had time to update the fxpage but will be getting through it on the weekend i hope. I'm terribly bogged down right now with too much going on.
Even my live accounts i managed to recover , today, finally!, but lost one acct (ALPARI- and not showing) when when JPY opened so ridiculously Sunday night.
Hope this BEAST works out, i dont need so many pairs going in the same direction at the same time.
sorry to be vague, but will update ASAP.

Heres the link for shortcut,
http://www.myfxbook.com/members/cuzgeor ... ast/391172

Thanks Pippo for keeping us informed. I'm very curious to see how this works.
cuz
10.X, BMac,Xmeter,Marylin,and CaptsNakedTrading thread coupled with Slowkeys Intraday setup for manual trades.
http://www.stevehopwoodforex.com/phpBB3 ... f=36&t=848
Locked

Return to “Automated trading systems”