MA/USA
Experience: Intermediate
Platform: Multicharts 64
Broker: AMP Futures
Trading: emini es
Posts: 72 since Oct 2015
Thanks Given: 30
Thanks Received: 53
|
Hi All,
I think someone replied asking if I was able to get this working. To me, no it is not working. Yet, what I have it not erroring out or throwing an error.
I think it is possible that it is working but compounded by another issue.
First this is what I have implemented between the calling signal and the receiving signal. And an alert that is supposed to catch any error thrown by the GV.
Part 1 - The sending signal. This is the signal that initiates the entry (in this case a short entry). This is to:
- trigger the sell
- capture the entry price
- set the GV to be retrieved by the receiving signal (Break Even signal)
...
if l_sellSig = true then
begin
Sell Short ("KltChSE v2.09") next bar at market;
l_entryPrice = entryprice;
IntRtn = GVSetInteger(2,l_entryPrice); // assign GV
if IntRtn <> 0 then
begin
Alert(Text("GVSet failed to set : ",IntRtn, l_entryPrice));
end;
//reset sell trigger
l_sellSig = false;
condition1 = false;
condition2 = false;
end;
Then the receiving signal. In this case a signal to set the BE stop is to:- Determine position entry
- retrieve the GV and assign it to a local variable
- Check if the value returned is an error or the entry price
- Then get the entry price and calculate the stop price
Effectively I am looking to set a stop +1tick above/below the entry price when the current price is N ticks away from the entry price.
if marketposition = -1 then
begin
g_entryPrice = GVGetInteger(2);
if g_entryPrice = -1 then
begin
Alert(Text("GVGet failed to get : ", g_entryPrice));
end;
if (g_entryPrice - Close) <= (MinMove * tickThreshold) then
StopPrice = g_entryPrice - MinMove;
buy to cover ("JZX_S1T") next bar StopPrice stop;
print("The entry price tied to JZX_S1T: ", g_entryPrice);
g_entryPrice = 0;
end;
I have tried different permutations of MinMove, etc. to calculate the stop price. What is happening is that a stop price does get set, but is not offset at all by the min move calculation. It looks to be just setting the stop price at the next tick price.
So a little inconclusive. Any thoughts?
Cheers,
JZ
|