Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Inputs: ThresholdValue(0);
- Variables: EntryPrice(0), ExitPrice(0), Difference(0), Result(0);
- condition1 = close > Average(close, 21);
- condition2 = close < Average(close, 21);
- If condition1 and EntryPrice=0 Then
- EntryPrice = Close
- else If condition2 Then Begin
- ExitPrice = Close;
- if EntryPrice <> 0 then
- Difference = ExitPrice - EntryPrice;
- EntryPrice =0;
- ExitPrice =0;
- End;
- If Difference >= ThresholdValue Then
- Result = 1
- Else
- Result = -1;
- Plot1(Result , "Risultato");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement