1 registered members (flink),
767
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Grid.c
[Re: jcl]
#449752
03/30/15 21:23
03/30/15 21:23
|
Joined: Feb 2015
Posts: 45 Italy
forexcoder
OP
Newbie
|
OP
Newbie
Joined: Feb 2015
Posts: 45
Italy
|
Thanks Jcl for your reply!!! And excuse me for my English. But I don't understood how the program place the pending orders higher than the Close. The cycle is this:
for(Price = 0; Price < Close+5*Grid; Price += Grid)
Suppose we are using EURUSD, with last price 1,32, so Close=1,32. So at the biginning of the cycle, Price=0 Then, after the first cycle: Price=Price+Grid=0+200PIP=0+200*0,0001=0+0,02=0,02 Then, the next cycle: Price=0,02+0,02=0,04 As you can see there will be a lot of cycles before arriving to 1,32+5*200 Instead I think that the solution could be this:
for(Price = Close; Price < Close+5*Grid; Price += Grid)
And than it it would take another cycle to place the pending orders lower the Close:
for(Price = Close; Price < Close-5*Grid; Price -= Grid)
I hope I explained. Thanks again.
|
|
|
Re: Grid.c
[Re: jcl]
#450134
04/07/15 09:23
04/07/15 09:23
|
Joined: Feb 2015
Posts: 45 Italy
forexcoder
OP
Newbie
|
OP
Newbie
Joined: Feb 2015
Posts: 45
Italy
|
I'm sorry but I do not understand what you say. If the price starts from zero than you would have the following: suppose we are using EURUSD, with last price 1,32, so Close=1,32. So at the biginning of the cycle, Price = 0 euro: Price=0 Then, after the first cycle: Price=Price+Grid=0+200PIP=0+200*0,0001=0+0,02=0,02 Then, the next cycle: Price=0,02+0,02=0,04 As you can see there will be a lot of cycles before arriving to 1,32+5*200 Where I am wrong?
|
|
|
Re: Grid.c
[Re: swingtraderkk]
#450188
04/08/15 11:40
04/08/15 11:40
|
Joined: Feb 2015
Posts: 45 Italy
forexcoder
OP
Newbie
|
OP
Newbie
Joined: Feb 2015
Posts: 45
Italy
|
Ok now it's clear. Thanks very much swingtraderkk. I have only a last question. Why is it necessary use the instruction '(TradeIsShort == IsShort)' in the: 'if((TradeIsShort == IsShort) and between(TradeEntryLimit,Price-Grid/2,Price+Grid/2))' ? I think it is sufficient write only: 'if between(TradeEntryLimit,Price-Grid/2,Price+Grid/2)' because it isn't necessary to know if a trade is short or long. Is it correct? Thanks a lot.
Last edited by forexcoder; 04/08/15 11:41.
|
|
|
|