Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (SBGuy, Quad), 768 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Tick Price function #480491
06/10/20 07:10
06/10/20 07:10
Joined: Aug 2019
Posts: 22
F
felixfx Offline OP
Newbie
felixfx  Offline OP
Newbie
F

Joined: Aug 2019
Posts: 22
So according to the manual, the price() function is just a mean price of the bar period.

Is there a way to set a Stop Order Entry based on actual Tick price?

I'm guessing maybe function tick() could do but I'm not quite figuring out how to do this...
If someone would be so kind to provide me some sample code on how this could be done I would surely be grateful.

Thank you

Re: Tick Price function [Re: felixfx] #480492
06/10/20 07:30
06/10/20 07:30
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
...
In a TMF or tick function, priceClose() returns the last price quote, updated every tick when new price data becomes available.

Re: Tick Price function [Re: felixfx] #480512
06/12/20 06:55
06/12/20 06:55
Joined: Aug 2019
Posts: 22
F
felixfx Offline OP
Newbie
felixfx  Offline OP
Newbie
F

Joined: Aug 2019
Posts: 22
Hi, thank you for the response. Doesn't a TMF manage ticks when the system is already in a trade?

I want to know how to trigger a trade based on ticks coming before the system is in a trade.

Thank you

Re: Tick Price function [Re: felixfx] #480513
06/12/20 06:58
06/12/20 06:58
Joined: Mar 2019
Posts: 357
D
danatrader Offline
Senior Member
danatrader  Offline
Senior Member
D

Joined: Mar 2019
Posts: 357
Activate TICKS in the Initrun.

Re: Tick Price function [Re: felixfx] #480515
06/12/20 07:42
06/12/20 07:42
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
define your code inside fce tick()
When the TICKS flag is set, the tick function is called at any new price quote in the historical data.

Code
// print every price quote in a file
function tick()
{
  
   var dAsk=priceClose(); 
}

function run()
{
   if (is(INITRUN))
   {
      set(TICKS);   // before asses
   }
}

Last edited by Grat; 06/12/20 07:44.
Re: Tick Price function [Re: felixfx] #480531
06/13/20 03:15
06/13/20 03:15
Joined: Mar 2020
Posts: 41
J
jbhunter Offline
Newbie
jbhunter  Offline
Newbie
J

Joined: Mar 2020
Posts: 41
I have been reading a book, High Probability Trading Strategies by Robert C Miner. He mentions a trailing 1 bar high entry. Up to this point I have not been using anything like this, and it has opened my eyes. When using this I have noticed higher probability of wins and high overall profit to confirm a trend before entry.

My code... I use a similar logic for short but setting the other direction. I simply use the set(TICKS). I don't implement a ticks() function.

Code
BarPeriod = 60;
set(TICKS);
TickTime = 3000;
Fill = 3; EntryTime = 3;
...
var buyEntry = priceHigh(1)+PIP
enterLong(0,buyEntry)



Result...
[Fri 20-06-12 14:00] 5007 0 +5.49 /\ (107.37)
[Fri 20-06-12 15:00] 5018 0 +16.24 /\ (107.34)
(AUD/USD:ONS:S) Short 16667@0.679970 Entry stop
[EUR/CHF:ONS:S] Skipped (Amount = 0)
(EUR/USD:ONS:L) Long 51679@1.14245 Entry stop
(GBP/USD:ONS:S) Short 12080@1.25357 Entry stop
(USD/CAD:ONS:L) Long 11848@1.35243 Entry stop
(USD/CAD:ONS:L) Entry stop 1.35243 hit by 1.36139 at 15:00:02
[USD/CAD:ONS:L00017] Long 11848@1.36140 at 15:00:02
(USD/JPY:ONS:S) Short 28234@106.58 Entry stop
(GBP/USD:ONS:S) Entry stop 1.25357 hit by 1.25344 at 15:02:41
[GBP/USD:ONS:S00019] Short 12080@1.25344 at 15:02:41

[Fri 20-06-12 16:00] 4998 0 -3.53 //\\''' (107.38)
[Fri 20-06-12 17:00] 5033 0 +31.67 //\\''' (107.51)
[Fri 20-06-12 18:00] 5095 0 +93.19 ///\''' (107.46)

Last edited by jbhunter; 06/13/20 05:02.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1