NexusFi: Find Your Edge


Home Menu

 





How i can change the number of ticks in the charts according to volatility


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,318 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 6 posts
    2. attach_file 2 attachments




 
Search this Thread

How i can change the number of ticks in the charts according to volatility

  #1 (permalink)
 ISRA63 
Tel Aviv, Israel
 
Experience: Intermediate
Platform: Sierra Chart
Trading: ES,NQ,STOCKS
Posts: 10 since Sep 2014
Thanks Given: 10
Thanks Received: 5

I am trying to write a strategy in trade station 10.
The strategy is in tick charts.How i can change the number of ticks in the charts according to volatility or time in easy language automatically.( may be using indicator in another chart ?).
Thank You

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Quant vue
Trading Reviews and Vendors
ZombieSqueeze
Platforms and Indicators
 
  #2 (permalink)
 Prototyper 
Reno Nevada
 
Experience: Intermediate
Platform: In flux
Trading: in Flux
Posts: 35 since Dec 2016
Thanks Given: 7
Thanks Received: 31

I've had a similar idea so I would like to know as well.

I'm thinking that a second set of calculated bars would need to be plotted. The calculated bars would be generated from the raw data, plus your indicator, generating an artificial bar (but its plotted as an indicator). Signals would still be execute on the raw data bars.

But that's just a guess. I am really just subscribing to your thread.

Reply With Quote
  #3 (permalink)
 ISRA63 
Tel Aviv, Israel
 
Experience: Intermediate
Platform: Sierra Chart
Trading: ES,NQ,STOCKS
Posts: 10 since Sep 2014
Thanks Given: 10
Thanks Received: 5



Prototyper View Post
I've had a similar idea so I would like to know as well.

I'm thinking that a second set of calculated bars would need to be plotted. The calculated bars would be generated from the raw data, plus your indicator, generating an artificial bar (but its plotted as an indicator). Signals would still be execute on the raw data bars.

But that's just a guess. I am really just subscribing to your thread.

Thank you for the reply.
It is good idea.
Please explain how to generate an artificial bar . Do you have code for that ?
Thank you again:

Started this thread Reply With Quote
  #4 (permalink)
 Prototyper 
Reno Nevada
 
Experience: Intermediate
Platform: In flux
Trading: in Flux
Posts: 35 since Dec 2016
Thanks Given: 7
Thanks Received: 31

I have MultiCharts (Easy Language compatible), and it has settings under "Format Instrument" to display data as tick bars, range bars, etc. You must have tick data as the raw source to do this. If your datasource is already time based (like 30 second bars, etc.), you cannot generate time independent bars.

That said, here's an example of "artificial bars". This doesn't solve the problem you posed though. This is just an example. Here, the underlying price data has been "de-trended" by finding the moving average and using that as a zero line for price.

Screenshot shows how to configure the indicators to display as if they are price bars.

VChart_1.pla


Reply With Quote
  #5 (permalink)
 ISRA63 
Tel Aviv, Israel
 
Experience: Intermediate
Platform: Sierra Chart
Trading: ES,NQ,STOCKS
Posts: 10 since Sep 2014
Thanks Given: 10
Thanks Received: 5


Prototyper View Post
I have MultiCharts (Easy Language compatible), and it has settings under "Format Instrument" to display data as tick bars, range bars, etc. You must have tick data as the raw source to do this. If your datasource is already time based (like 30 second bars, etc.), you cannot generate time independent bars.

That said, here's an example of "artificial bars". This doesn't solve the problem you posed though. This is just an example. Here, the underlying price data has been "de-trended" by finding the moving average and using that as a zero line for price.

Screenshot shows how to configure the indicators to display as if they are price bars.

Attachment 298041

Attachment 298038

Hi,
Thank you for the reply.
The multicharts link
VChart_1 ,I cannot import to Tradestation.
Please advice me how to convert it to Trade station easy language.

Isra63

Started this thread Reply With Quote
  #6 (permalink)
 Prototyper 
Reno Nevada
 
Experience: Intermediate
Platform: In flux
Trading: in Flux
Posts: 35 since Dec 2016
Thanks Given: 7
Thanks Received: 31

 
Code
{Value Chart Indicator
found on a forum
http://www.traderslaboratory.com/forums/topic/2107-ttmddf-value-chart/}

Inputs:NumBars(5);

Variables:Vopen(0),VHigh(0),VLow(0),VClose(0),Var1(0),Var2(0);

Var: VcloseLam(0),ValueSOB(" "),ValueMOB(" "),ValueMOS(" "), ValueSOS(" "), ValueFair(" "), lastdate(0);

 

 

{Calcualte Value Chart}

VOpen = VChart_1(NumBars,Open);

VHigh = VChart_1(NumBars,High);

VLow = VChart_1(NumBars,Low);

VClose = VChart_1(NumBars,Close);

 

 

If currentbar > Numbars then Begin

Plot1(VOpen,"VOpen");

Plot2(VHigh,"VHigh");

Plot3(VLow,"VLow");

Plot4(VClose,"VClose");

Plot5(8,"8");

Plot6(4,"4");

Plot7(-4,"-4");

Plot8(-8,"-8");

Plot9(0,"0");

End;
 
Code
{Value Chart function
found on a forum
http://www.traderslaboratory.com/forums/topic/2107-ttmddf-value-chart/}

Inputs:NumBars(Numeric),Price(NumericSeries);

 

Variables:VarNumBars(0),Var0(0),LRange(0),YDiv(0),RanVar4(0),VOpen(0),VHigh(0),VLow(0),VClose(0),

VarA(0),VarB(0),VarC(0),VarD(0),VarE(0),VarP(0),VarR1(0),VarR2(0),VarR3(0),VarR4(0),VarR5(0);

 

{Insure NumBars is between 2 and 1000}

If NumBars < 2 then VarNumBars = 2;

If Numbars > 1000 then VarNumBars = 1000;

If Numbars >= 2 and NumBars <=1000 then VarNumBars = NumBars;

 

VarP=Round(VarNumBars/5,0);

 

If VarNumBars >7 then begin

VarA=Highest(H,VarP)-Lowest(L,VarP);

If VarA = 0 and VarP=1 then VarR1=absvalue(C-C[VarP]) Else VarR1 = VarA;

VarB=Highest(H,VarP)[VarP+1]-Lowest(L,VarP)[VarP];

If VarB = 0 and VarP=1 then VarR2=absvalue(C[VarP]-C[VarP*2]) Else VarR2 = VarB;

VarC=Highest(H,VarP)[VarP*2]-Lowest(L,VarP)[VarP*2];

If VarC = 0 and VarP=1 then VarR3=absvalue(C[VarP*2]-C[VarP*3]) Else VarR3 = VarC;

VarD=Highest(H,VarP)[VarP*3]-Lowest(L,VarP)[VarP*3];

If VarD = 0 and VarP=1 then VarR4=absvalue(C[VarP*3]-C[VarP*4]) Else VarR4 = VarD;

VarE=Highest(H,VarP)[VarP*4]-Lowest(L,VarP)[VarP*4];

If VarE = 0 and VarP=1 then VarR5=absvalue(C[VarP*4]-C[VarP*5]) Else VarR5 = VarE;

LRange=((VarR1+VarR2+VarR3+VarR4+VarR5)/5)*.2;

End;

 

 

If VarNumBars <=7 then Begin

If AbsValue(C-C[1]) > (H-L) then Var0=AbsValue(C-C[1]) else var0=(H-L);

If H=L then Var0=absvalue(C-C[1]);

LRange=Average(Var0,5)*.2;

End;

 

If LRange > 0 then begin

If Price = Open then

VChart_1=((Open-Average((H+L)/2,VarNumBars)))/(LRange);

If Price = High then

VChart_1=((High-Average((H+L)/2,VarNumBars)))/(LRange);

If Price = Low then

VChart_1=((Low-Average((H+L)/2,VarNumBars)))/(LRange);

If Price = Close then

VChart_1=((Close-Average((H+L)/2,VarNumBars)))/(LRange);

End;

Reply With Quote
  #7 (permalink)
 
Sandpaddict's Avatar
 Sandpaddict 
Vancouver, Canada
 
Experience: Advanced
Platform: Ninjatrader, MT4
Broker: IB, Global Prime
Trading: Futures CFDs
Posts: 684 since Mar 2020
Thanks Given: 975
Thanks Received: 637


ISRA63 View Post
I am trying to write a strategy in trade station 10.
The strategy is in tick charts.How i can change the number of ticks in the charts according to volatility or time in easy language automatically.( may be using indicator in another chart ?).
Thank You

I have not used Tradestation/easylanguage in a few years but my first thought would be to use switch function or condition to set ticks and some kind of ATR multiplier for volatility. (Coded output of atr indicator times multiplier)

Hopefully that helps, maybe you thought already?

Good luck

Sent using the NexusFi mobile app

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on May 18, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts