Search found 5 matches

by stevenasmith1982
17 Jun 2014
Forum: MultiCharts
Topic: How to get a strategy to recognize strategy start bar
Replies: 6
Views: 1649

Re: How to get a strategy to recognize strategy start bar

that shouldn't be the case. Both grow with every bar and are independent from the calculation cycles of your code. CurrentBar = 1 should be the first bar the strategy is computed on after the Max bars back. So in case your max bars back is set to 50, what your strategy returns as CurrentBar = 1 is ...
by stevenasmith1982
14 Jun 2014
Forum: MultiCharts
Topic: How to get a strategy to recognize strategy start bar
Replies: 6
Views: 1649

Re: How to get a strategy to recognize strategy start bar

I've just worked out a "Start" function that could do the trick. Again, let me know If IntervalType_ex = 4 then begin Value1 = LastCalcJDate / BarInterval ; Once Value2 = LastCalcJDate / BarInterval ; Start = Value1 - Value2; end; If IntervalType_ex = 3 then begin Value1 = ((LastCalcJDate*24) + Hour...
by stevenasmith1982
13 Jun 2014
Forum: MultiCharts
Topic: How to get a strategy to recognize strategy start bar
Replies: 6
Views: 1649

Re: How to get a strategy to recognize strategy start bar

Yup, I'm an Idgit. :-)
CurrentBar and BarNumber both go up with every intrabar recalculation.
Which means they quickly grow larger than the actual bars back than I'm trying to reference.
I need a way to tell this machine to only look back to a bar than can be "locked in" at the
start of the strategy.
by stevenasmith1982
13 Jun 2014
Forum: MultiCharts
Topic: How to get a strategy to recognize strategy start bar
Replies: 6
Views: 1649

Re: How to get a strategy to recognize strategy start bar

can you expand on your code example and question? My strategy concept is to create a true trailing stop that doesn't require a profit target to trigger before percent profit gets locked in, then apply it to long and flat positions. It started off looking something like this: Inputs: Len (0), PctTrl...
by stevenasmith1982
11 Jun 2014
Forum: MultiCharts
Topic: How to get a strategy to recognize strategy start bar
Replies: 6
Views: 1649

How to get a strategy to recognize strategy start bar

I'm working on a strategy that references the highest high and lowest low since exit of the last position while flat. However, BarsSinceExit(1) will look back forever for a previous exit. So far, I've got this: Once Var1 = ComputerDateTime; // Var2 = convert Var1 into a "BarsAgo" number ------ This ...

Go to advanced search