Help needed in coding afl - AmiBroker | futures.io
futures.io futures trading


Help needed in coding afl
Started: by milkysahai001 Views / Replies:476 / 0
Last Reply: Attachments:0

Welcome to futures io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Reply
 
Thread Tools Search this Thread
 

Help needed in coding afl

  #1 (permalink)
Trading Apprentice
Agra+India
 
Futures Experience: Beginner
Platform: MultiCharts, AmiBroker
Favorite Futures: Stock Futures
 
Posts: 35 since Sep 2016
Thanks: 11 given, 1 received

Help needed in coding afl

below is my simple stochastics strategy.i am using this on symphony presto amifuse trading on this bar close price.
i want the trades to take place on next bar open price. but not able to do so. i have also attached the code for presto amifuse- for signal generation.
please help me in getting signals on next bar open.


P=Param("Periods", 14, 5, 30, 1);
PD=Param("Oscillator Avg", 3, 3, 30, 1);
PD1=Param("Smooth1", 3, 3, 30, 1);

res=HHV(H,P);
sup=LLV(L,P);
avd=IIf(C>Ref(res,(RP*-1)), 1, IIf(C<Ref(sup,(RP*-1)), -1, 0));
avn=ValueWhen(avd!=0,avd,1);
tsl=IIf(avn==1,sup,res);
Plot(tsl, "trend", colorWhite, styleStaircase);

A=Close;
B=(A-LLV(L,P))/(HHV(H,P)-LLV(L,P));
D=MA(B,PD);
D1=MA(D, PD1);

Buy=((Cross(D, D1) AND avn==1));
Sell=D<D1;
Short=((Cross(D1, D) AND avn==-1));
Cover=D>D1;

Buy=ExRem(Buy, Sell);
Sell=ExRem(Sell, Buy);
Short=ExRem(Short, Cover);
Cover=ExRem(Cover, Short);

PlotShapes(IIf(LongSignal, shapeUpArrow, shapeNone), colorWhite);
PlotShapes(IIf(ShortSignal, shapeDownArrow, shapeNone), colorYellow);
PlotShapes(IIf(Sellsignal, shapeStar, shapeNone), colorYellow);
PlotShapes(IIf(CoverSignal, shapeStar, shapeNone), colorWhite);

_SECTION_BEGIN("presto1");
a2=(Sell);
a4=(Cover);
a1=(Buy);
a3=(Short);
a5=Ref(C,-1);
a6=Ref(C,-1);
a7=0;

if(a2[BarCount-2]==1)
{
SellToFuse(a5[BarCount-1],a6[BarCount-2]);
}

if(a4[BarCount-2]==1)
{
CoverToFuse(a5[BarCount-1],a6[BarCount-2]);
}

if(a1[BarCount-2]==1)
{
BuyToFuse(a5[BarCount-1],a7[BarCount-2]);
}
if(a3[BarCount-2]==1)
{
ShortToFuse(a6[BarCount-1],a7[BarCount-2]);
}
_SECTION_END();

Reply With Quote

Reply



futures io > > > > Help needed in coding afl

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

Al Brooks: When A Good Trade Goes Bad (Risk and Probabilities)

Elite only

Ran Aroussi: Quant Trading with Python

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed for NT7 coding mphoenix NinjaTrader Programming 2 December 18th, 2016 06:41 PM
help needed in coding a variable in afl. milkysahai001 AmiBroker 6 December 15th, 2016 05:54 AM
help needed in coding some variables in easy/powerlanguage! milkysahai001 MultiCharts 3 November 16th, 2016 05:49 AM
Little coding help needed Abde NinjaTrader 8 April 10th, 2014 12:45 PM
Stochastics coding help needed! RodS NinjaTrader Programming 33 October 24th, 2009 06:58 PM


All times are GMT -4. The time now is 05:05 PM.

no new posts
Page generated 2017-02-21 in 0.06 seconds with 21 queries on phoenix via your IP 54.146.176.30