How To Reference Another Symbol's Values

dsr29

Newbie
Messages
1
Likes
0
I have a chart of the Nasdaq e-minis and I inserted another symbol ($TICK) into the chart. When I look in Format Symbol, the chart for $TICK is called Data2. How do I reference the values of $TICK in my strategy for the NQ?

Thanks much.
 
I have a chart of the Nasdaq e-minis and I inserted another symbol ($TICK) into the chart. When I look in Format Symbol, the chart for $TICK is called Data2. How do I reference the values of $TICK in my strategy for the NQ?

Thanks much.

As long as the two data sources are in the same chart analysis window you can create any formula just referencing the data source numbers. The data source numbers are assigned sequentially as you add more plots, so it is important to ensure you reference the correct ones.

You create an indicator along the lines of the one shown below. In this case I am looking at the percentage change in closing price if the 2 plots over a period of 10 bars and subtracting one from the other. You see that the data plot number is added after the "Close".

You then Insert the indicator into the chart window. This example is shown below.

Inputs: Period(10);
Variables: PCT_BA(0), PCT_APPL(0), REL_PCT(0);

PCT_APPL = PercentChange(Close Data1, Period);
PCT_BA = PercentChange(Close Data2, Period);


REL_PCT = PCT_APPL - PCT_BA;

Plot1(REL_PCT, "Rel change");
Plot2(0, "Baseline");


For more complex examples where you reference data in other windows you would need to use global variables, but that is too complex to go into at this stage

Charlton
 

Attachments

  • two datasource example.png
    two datasource example.png
    43.8 KB · Views: 352
Top