Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Edgar_Herrera, VoroneTZ, Akow), 973 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Grid Trading - dynamic #480711
07/01/20 17:15
07/01/20 17:15
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
I'd like to create a dynamic grid system and maybe someone can give me a starting point.

The grid should be created out of points that happened in the past, e.g. SMA10 cross SMA50 (really bad example, I got better things with more validity), the cross is the horizontal level to remember.
Later on, the levels if crossed by price with a certain condition, e.g. Momentum > x should trigger a trade.

Any help how to get started on something like that would be really nice.

Question is, how to remember the levels?
Any level crossed should loose validity, oldest to newer.

Would anyone here be interested to develop such a system together?

Last edited by danatrader; 07/01/20 17:20.
Re: Grid Trading - dynamic [Re: danatrader] #480873
07/21/20 06:01
07/21/20 06:01
Joined: Jun 2019
Posts: 24
Q
Qw3rty Offline
Newbie
Qw3rty  Offline
Newbie
Q

Joined: Jun 2019
Posts: 24
You can try the Grid trading system that comes with Zorro as a base and build on that.

// Grid trader

// find all trades at a grid line
bool findTrade(var Price,var Grid,bool IsShort)
{
int result = false;
for(open_trades)
if((TradeIsShort == IsShort)
and between(TradeEntryLimit,Price-Grid/2,Price+Grid/2)) {
result = true;
break_trades;
}
return result;
}

int run()
{
BarPeriod = 1440;
Hedge = 2; // allow long & short trades at the same time

EntryTime = LifeTime = 250; // close trades after 1 year
var Price, Grid = 200*PIP; // set grid distance to 200 pips
var Close = priceClose();

// place pending trades at 5 grid lines
// above and below the current price
for(Price = 0; Price < Close+5*Grid; Price += Grid)
{
// find the lowest grid line
if(Price < Close-5*Grid) continue;
// place not more than 200 trades
if(NumOpenTotal + NumPendingTotal > 200) break;
// place short trades below the current price
if(Price < Close and !findTrade(Price,Grid,true))
enterShort(1,Price,20*Grid,Grid);
// place long trades above the current price
else if(Price > Close and !findTrade(Price,Grid,false))
enterLong(1,Price,20*Grid,Grid);
}
}

Re: Grid Trading - dynamic [Re: danatrader] #480877
07/21/20 10:35
07/21/20 10:35
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
Actually yes, that would be a start, but how would you memorize the levels based on price activity that happend in the past?
Use a series of the price levels.
How limit the amount of levels -> limit the series by it's length.

Yes, thank you that could be a start.

Re: Grid Trading - dynamic [Re: danatrader] #480890
07/22/20 09:42
07/22/20 09:42
Joined: Jun 2019
Posts: 24
Q
Qw3rty Offline
Newbie
Qw3rty  Offline
Newbie
Q

Joined: Jun 2019
Posts: 24
Grid trading seems to be more tricky to code for this very reason of dynamic entries based on past results. That's why a lot of grid strategies are based on moving averages or static gridlines 100pips apart.

I guess you could potentially store the values/condition in an array and enter the trade based on the historical key points e.g. if (price > array[0] or price > array[1] or price > array[2] etc.) then enter long

Last edited by Qw3rty; 07/22/20 09:43.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1