Someone has asked me to write this script for them and i can't understand what they mean

tp376640tp376640 Posts: 1

So this is what he wants

He wants to create a series of variables/parameters that would be called in the main program. Then set up the main algorithm by calling the data for the instrument(s) to be traded. If condition 1 is true then buy. If condition 2 is true then sell etc. Each condition looks at the current values of the various variable/parameters to see if they are high or low enough. The qualifying levels are set as inputs (ideally) which could be optimized using their backtest capability.

He gave me this

_Inputs: lkbk(numeric);
Vars:Z1(0),Z2(0);

Z1=(close-Average(close,lkbk))/StdDev(absvalue(close-close[1]),20);
Z2=(close of data2-Average(close of data2,lkbk))/StdDev(absvalue(close of data2-close[1] of data2),20);

Vasev =Z1-Z2;
_

I'm Just not fully sure what he meant by all this

Answers

  • aj165602aj165602 Posts: 105

    Z most commonly refers to normalised values related to the Standard Normal distribution in statistics. Your client is asking you to create variables with a zero mean, and to then measure the distance of the latest close from the mean in terms of 20-day volatility.

    It also looks like a relative-value exercise, possibly a pairs trade, as one Z-score is being subtracted from the other.

  • carcarcarcar Posts: 5

    Would you be able to help me 10-20 mins im trying to learn to code. I am stuck on something I am trying to code and have spent hours trying to understand how to fix it. I could pay you possibly.

Sign In or Register to comment.