looking for a partner with a high-frequency trading system - page 21

 

You have chosen the right direction!

Only practical questions remain about the implementation of the project.

You don't need me now.

 
inputs:
AssetPr( 0 ),
YearsLeft( 0 ),
MyGamma( 0 ),
MyH( 0 ),
TriggerPr( 0 ),
Rate( 0 ),
Carry( 0 ),
Volty( 0 ) ;

variables:
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ),
var4( 0 ),
var5( 0 ) ;



var0 = Square( Volty ) ;
var1 = SquareRoot( YearsLeft ) ;

var2 = ( -Rate + MyGamma * Carry + .5 * MyGamma * ( MyGamma - 1 ) * var0 )
* YearsLeft ;
var3 = -( Log( AssetPr / MyH ) + ( Carry + ( MyGamma - .5 ) * var0 )
* YearsLeft ) / ( Volty * var1 ) ;
var4 = 2 * Carry / var0 + 2 * MyGamma - 1 ;
var5 = var3 - 2 * Log( TriggerPr / AssetPr ) / ( Volty * var1 ) ;
Value44 = ExpValue( var2 ) * Power( AssetPr, MyGamma )
* ( NormSCDensity( var3 ) - Power( TriggerPr / AssetPr, var4 )
* NormSCDensity( var5 ) ) ;
 

Or???? So.

using tsdata.trading ;
using tsdata.marketdata ;
using elsystem ;

Input: string iAccount1( "SIM587052F" ),
string iSymbol1( "ESH11" ),
string iSymbol2( "NQH11" ),
Length(20),NumStdDev(2),
ProfitTarget$(20),
StopLoss$(20);

vars: order ES_order1(NULL),
order ES_order2(NULL),
longentrycond(false),shortentrycond(false),
close1(0),close2(0),
RelStr(0),bandup(0),banddw(0),RelStrMovAvg(0),
color(0),mp(0),OpenProfit(0),text_("");

once
begin
PSP1.Load=False;
PSP1.Interval = DataInterval.FromCurrentSymbolData( BarType, BarInterval ) ;
PSP1.Range.FirstDate = DateTime.FromELDateAndTime( Date, Time ) ;
PSP1.Load = true ;
PSP2.Load=False;
PSP2.Interval = DataInterval.FromCurrentSymbolData( BarType, BarInterval ) ;
PSP2.Range.FirstDate = DateTime.FromELDateAndTime( Date, Time ) ;
PSP2.Load = true ;
end;


Once Begin
myorder1.Symbol = isymbol1;
myorder1.SymbolType = tsdata.common.SecurityType.future;
myorder1.Account = iaccount1;
myorder1.Type = tsdata.trading.OrderType.market;
myorder1.Duration = "day";
myorder1.LimitPrice = 0.000000;
myorder1.LimitPriceStyle = tsdata.trading.PriceStyle.none;
myorder1.LimitPriceOffset = 0;
myorder1.StopPrice = 0.000000;
myorder1.StopPriceStyle = tsdata.trading.PriceStyle.none;
myorder1.StopPriceOffset = 0;


myorder2.Symbol = isymbol2;
myorder2.SymbolType = tsdata.common.SecurityType.future;
myorder2.Account = iaccount1;
myorder2.Type = tsdata.trading.OrderType.market;
myorder2.Duration = "day";
myorder2.LimitPrice = 0.000000;
myorder2.LimitPriceStyle = tsdata.trading.PriceStyle.none;
myorder2.LimitPriceOffset = 0;
myorder2.StopPrice = 0.000000;
myorder2.StopPriceStyle = tsdata.trading.PriceStyle.none;
myorder2.StopPriceOffset = 0;
end;


//get data from priceseriesprovider, calculate RelativeStrength and Indicators
close1=PSP1.close[0];
close2=PSP2.close[0];
if close2<>0 then RelStr = close1/close2;
RelStrMovAvg = average(RelStr,length);
bandUp=BollingerBand(RelStr,length, NumStddev);
bandDw=BollingerBand(RelStr,length,-NumStddev);

LongEntryCond = RelStr crosses below banddw;
ShortEntryCond = RelStr crosses above bandup;

mp= Getpositionquantity(iSymbol1,iAccount1);
OpenProfit = getpositionopenpl(iSymbol1,iAccount1)+Getpositionopenpl(iSymbol2,iaccount1);

If LastBarOnChart and barstatus(1)=2 then begin

if mp=0 and longentrycond then begin
myorder1.Quantity = 1;
myorder2.Quantity = 1;
myOrder1.Action = tsdata.trading.OrderAction.buy;
MyOrder2.Action = tsdata.trading.OrderAction.sell;
ES_order1 = MyOrder1.Send();
ES_order2 = MyOrder2.Send();
value1=text_new(date,time,low, "Entry Long");
end;

if mp=0 and shortentrycond then begin
myorder1.Quantity = 1;
myorder2.Quantity = 1;
MyOrder1.Action = tsdata.trading.OrderAction.sell;
MyOrder2.Action = tsdata.trading.OrderAction.buy;
ES_order1 = MyOrder1.Send();
ES_order2 = MyOrder2.Send();
value2=text_new(date,time,high, "Entry Short");
end;

if mp=1 and shortentrycond then begin
myorder1.Quantity = 2;
myorder2.Quantity = 2;
MyOrder1.Action = tsdata.trading.OrderAction.sell;
MyOrder2.Action = tsdata.trading.OrderAction.buy;
ES_order1 = MyOrder1.Send();
ES_order2 = MyOrder2.Send();
value3=text_new(date,time,high, "Short Reverse");
end;

if mp=-1 and longentrycond then begin
myorder1.Quantity = 2;
myorder2.Quantity = 2;
MyOrder1.Action = tsdata.trading.OrderAction.buy;
MyOrder2.Action = tsdata.trading.OrderAction.sell;
ES_order1 = MyOrder1.Send();
ES_order2 = MyOrder2.Send();
value4=text_new(date,time,low, "Long Reverse");
end;

end;

//Profittarget % StopLoss Any tick
if mp=1 and OpenProfit> ProfitTarget$ then begin
myorder1.Quantity = 1;
myorder2.Quantity = 1;
myOrder1.Action = tsdata.trading.OrderAction.sell;
myOrder2.Action = tsdata.trading.OrderAction.buy;
ES_order1 = MyOrder1.Send();
ES_order2 = MyOrder2.Send();
value5=text_new(date,time,close, "TargetLong");
end;

if mp=-1 and OpenProfit> ProfitTarget$ then begin
myorder1.Quantity = 1;
myorder2.Quantity = 1;
myOrder1.Action = tsdata.trading.OrderAction.buy;
myOrder2.Action = tsdata.trading.OrderAction.sell;
ES_order1 = MyOrder1.Send();
ES_order2 = MyOrder2.Send();
value6=text_new(date,time,close, "TargetShort");
end;


if mp=1 and OpenProfit<-StopLoss$ then begin
myorder1.Quantity = 1;
myorder2.Quantity = 1;
myOrder1.Action = tsdata.trading.OrderAction.sell;
myOrder2.Action = tsdata.trading.OrderAction.buy;
ES_order1 = MyOrder1.Send();
ES_order2 = MyOrder2.Send();
value5=text_new(date,time,close, "StopLong");
end;

if mp=-1 and OpenProfit<-StopLoss$ then begin
myorder1.Quantity = 1;
myorder2.Quantity = 1;
myOrder1.Action = tsdata.trading.OrderAction.buy;
myOrder2.Action = tsdata.trading.OrderAction.sell;
ES_order1 = MyOrder1.Send();
ES_order2 = MyOrder2.Send();
value6=text_new(date,time,close, "StopShort");
end;

 

No reaction. Must have liked it, the wheelset?

//----

As you've probably realised by now? I'm not posting any super-duper secrets here. But! If even that! Amazing to you! No words. Shall we start again? For those of you who missed my lectures?

Or? Let's finish at last. At this?

 

I see a lot of people are starting to get a bit cliffy lately.

I wonder what that has to do with it.

 

//---

Good question.

It has everything to do with the apple trade. If we buy apples and pay for them with bananas. Then naturally we would need some calculations. That's exactly the calculation I presented.

 

/// Oh, you've got it so messed up. In a serious forum, you would have started trying the codes presented and you'd be asking questions. You are definitely fixated on the wheelsets. And you will not be moved.

 

///--------------------------------------

It's all about my incredibly low self-esteem. And I probably won't be able to achieve anything in this life on my own.

 

//---

While researching one of the data providers, I won't go into detail and fool you as to why, I did. After a month, disconnected. Since I wasn't betting, on a practice account. I got angry and made one, on UERUSD . Bought Euro, maybe a week ago, sold 4 days later. Sold because I made 400 quid. Didn't do anything. I wasn't watching the exchange rate at the time. And if I say that the trend has changed. And you don't have to think, just buy?????? Please don't take my jokes seriously, or my head will be in trouble.

 

///-------

Yes! I would like to warn agents with many nicknames. I'm not moving to another thread. Well I'm lazy about all this!!!!

Or maybe it's simpler, Marilyn Monroe, I like??????

http://www.gotovim.ru/recepts/salad/kalmary/