Gamestudio Links
Zorro Links
Newest Posts
2 questions
by jcl. 08/14/20 12:50
New Zorro version 2.30
by jcl. 08/14/20 12:48
Reducing Function Times
by txesmi. 08/14/20 12:13
NeoDumont's open world treadmill project
by NeoDumont. 08/13/20 23:33
Corvitextu texture browser released...
by NeoDumont. 08/13/20 23:19
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/13/20 12:00
AUM Magazine
Latest Screens
Untitled Walking Simulator
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
Who's Online Now
8 registered members (kvm, AndrewAMD, txesmi, 3run, alibaba, danatrader, Superku, 1 invisible), 485 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Janusz, Sovattha, DonSergio, bigimpactsound, tzw101
18492 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: 220
D
danatrader Online OP
Member
danatrader  Online OP
Member
D

Joined: Mar 2019
Posts: 220
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: 23
Q
Qw3rty Offline
Newbie
Qw3rty  Offline
Newbie
Q

Joined: Jun 2019
Posts: 23
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: 220
D
danatrader Online OP
Member
danatrader  Online OP
Member
D

Joined: Mar 2019
Posts: 220
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: 23
Q
Qw3rty Offline
Newbie
Qw3rty  Offline
Newbie
Q

Joined: Jun 2019
Posts: 23
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