Tick Price function

Posted By: felixfx

Tick Price function - 06/10/20 07:10

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
Posted By: Grat

Re: Tick Price function - 06/10/20 07:30

...
In a TMF or tick function, priceClose() returns the last price quote, updated every tick when new price data becomes available.
Posted By: felixfx

Re: Tick Price function - 06/12/20 06:55

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
Posted By: danatrader

Re: Tick Price function - 06/12/20 06:58

Activate TICKS in the Initrun.
Posted By: Grat

Re: Tick Price function - 06/12/20 07:42

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
   }
}
Posted By: jbhunter

Re: Tick Price function - 06/13/20 03:15

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)
© 2024 lite-C Forums