I've read a couple of times that there might be somone willing to consult for a fee. Would this be in this group or outside. I do have a little knowledge of AB. But obviously not deep enough. I hope I can afford the consulting fees though.
Simply ask here what you need to know.
Mr. Fxshrat is very kind and generous , please help me. Because there hasn't been anyone who helped and provided a solution. Thanks
Thanks for your reply. I am doing AA Long/Short on about 20 symbols. I have tired all sorts of things like chasing a spike up/down and tightening up my trail, so I don't give back the gain on the coming dip. At the end of the day I still end up red. I was trying to manage the Exit mostly. The code seems to work but the results are quite disappointing... Not to mention the fact that I can't really simulate the Trail changes in AB. Basically chief, I need some direction on how to get some green at the end of the day. I feel that I'm missing the bigger picture.
`
/*
chaserTrigger = .003; // Margin on Profit before any Adjustments. s/b > .005
spikeTrigger = .3; // ROC spike before any adjustment
spikeMargin = .7; // Adjustment. Need some room to move still.. was 1.3
slopeAdjuster = .8; // Gradual sloping.
slopeTrigger = .09;
if( bTrailP == -1 AND LastTrade == "BUY" AND BuyPending == 0 ) // Just the Trail.
{
aPrice = ibc.GetExecInfo( BuyOrderID, "Avg. price" ); // Get Average Price.
//aPrice = StaticVarGet( "entryPrice" + ABName );
LastC = LastValue( C );
prevAvePrice = StaticVarGet( "prevAvePrice" + ABName );
//prevOffset = StaticVarGet( "prevOffset" + ABName );
if( prevAvePrice == 0 ) { // First time in?
StaticVarSet( "prevAvePrice" + ABName, aPrice ); // Reload Orig. Ave. Price
StaticVarSet( "prevOffset" + ABName, baseStop ); // Reload Defaults.
}
prevAvePrice = StaticVarGet( "prevAvePrice" + ABName );
prevOffset = StaticVarGet( "prevOffset" + ABName );
if( LastC > prevAvePrice ) // Any increase since last checked?
{
pChaser = 1 - ( prevAvePrice / LastC ); // Get percent of increase.
if( pChaser >= chaserTrigger ) // Cutting out too fast at < .4
{
if( prevOffset > 1 ) // Has it reached the MINIMUM?
{
if( LastValue( ROC( C, 4 ) ) > spikeTrigger AND prevOffset > spikeMargin ) { // Spike UP
prevOffset = spikeMargin; // Need top give it more room. Was too close at 1
Say( "Spike up on" + ABName, 0 );
}
else if( LastValue( ROC( C, 4 ) ) < slopeTrigger ) {
prevOffset = prevOffset * slopeAdjuster;// Decrease the stop gap.
Say( "Adjusted up" + ABName, 0 );
}
if( prevOffset != StaticVarGet( "prevOffset" + ABName ) ) {
//prevOffset = IIf( prevOffset < 1, .7, prevOffset ); // Make sure there is a Minimum
sTrailStop = prevOffset * LastValue( ATR( 7 ) ); // Setup the new stop
if( sTrailStop < .01 ) sTrailStop = .01;
nTrailOID = ibc.ModifyOrder( bTrailOID, ABName, "SELL", 100, "TRAIL", LastValue( C ),
sTrailStop, "GTC", True );
StaticVarSet( "prevOffset" + ABName, prevOffset );
StaticVarSet( "prevAvePrice" + ABName, LastC );
StaticVarSetText( "buyTrailOrderID" + ABName, nTrailOID );
if( trace3On ) _TRACE("#3.2: BTrail: " + ABName +
" prevAvePrice=" + prevAvePrice +
" sTrailStop=" + sTrailStop +
" prevOffset=" + prevOffset +
" pChaser=" + pChaser +
" openPos=" + curIBOpenPos +
" LastC=" + LastC
);
}
}
}
}
}
*/
`