Guidance with entry code

Questions about MultiCharts and user contributed studies.
ax
Posts: 34
Joined: 21 Nov 2005
Has thanked: 15 times
Been thanked: 2 times

Guidance with entry code

Postby ax » 03 Dec 2008

I am trying to place a strategy order above the price of an entry signal for a short and below the entry signal for a long.

IF Condition1 OR Condition2 then EPl =(Low [1]);
If Condition3 or Condition4 then EPS =(High[1]);

Entryprice = (EPS +4* minmove);
Entryprice1 = (EPl -4* minmove);

If Golong = true then begin
buy("GoLong") next bar entryprice1 limit;
end;

If GoShort = True then begin
sellshort ("GoShort") next bar entryprice limit;
end;


The above does not work
“next bar market”will generate an order as will a negative minmove for a short entry

Any help would be most appreciated

Thanks
ax

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 04 Dec 2008

Hi ax,

Could you please specify what exactly it is that you want the strategy to do? So far, it is not quite clear.

Regards.

ax
Posts: 34
Joined: 21 Nov 2005
Has thanked: 15 times
Been thanked: 2 times

Postby ax » 05 Dec 2008

Hi Marina
Thank you for your interest and thank you for all the value you bring to this forum.

I will try to explain better what I am trying to bring about:

In any given bar that a condition turns from false to = true

I want to place buy limit order for the next bar at – 4*minmove of the price scale, below the “low” of the bar in which the related condition turned true,

and similar + 4*minmove above the “high” of the bar for a short entry.

Also I would like the added option to place an order +/- x#* minmove from the close of the relevant bar.

(The condition for a long entry requires an opposite value to the short entry and they cannot exist in the same bar)

I would want any order to remain in place until a separate and disparte condition turns true and cancels.

I hope I have been clear enough.

ax

SUPER
Posts: 646
Joined: 03 Mar 2007
Has thanked: 106 times
Been thanked: 84 times

Postby SUPER » 05 Dec 2008

IF Condition1 OR Condition2 then EPl =(Low [1]);
If Condition3 or Condition4 then EPS =(High[1]);

Entryprice = (EPS +4* minmove);
Entryprice1 = (EPl -4* minmove);

If MarketPosition<>1 and Golong = true then begin
buy("GoLong") next bar entryprice1 limit;
end;

If MarketPosition<>-1 and GoShort = True then begin
sellshort ("GoShort") next bar entryprice limit;
end;

I would add marketposition check in your code and maybe it will do the trick for you.


Return to “MultiCharts”